Skip to content

Commit

Permalink
feat(soffit-pwa): separate content file
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Feb 8, 2023
1 parent 090a615 commit 58ed218
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 165 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-len */
import type {PageHomeContent, ProductPageContent} from '../type.js';
import type {PageHomeContent} from '../type.js';

export const homePageContent: PageHomeContent = {
topAppBar: {
Expand Down Expand Up @@ -129,79 +129,3 @@ export const homePageContent: PageHomeContent = {

agencyList: [],
};

export const productPageContent: ProductPageContent = {
topAppBar: {
type: 'large',
headline: 'Ceiling tile product',
startIcon: {icon: 'arrow-back-outline'},
endIconList: [{icon: 'globe-outline', clickSignalId: 'language-button-click-event'}, {icon: 'menu-outline', flipRtl: true}],
},

product: [
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
],
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-len */
import {replaceNumber} from '@alwatr/i18n';

import type {PageHomeContent, ProductPageContent} from '../type.js';
import type {PageHomeContent} from '../type.js';

export const homePageContent: PageHomeContent = {
topAppBar: {
Expand Down Expand Up @@ -405,82 +405,3 @@ export const homePageContent: PageHomeContent = {
},
],
};

export const productPageContent: ProductPageContent = {
topAppBar: {
type: 'large',
headline: 'محصولات تایل سقفی',
startIcon: {icon: 'arrow-back-outline', flipRtl: true},
endIconList: [
{icon: 'globe-outline', clickSignalId: 'language-button-click-event'},
{icon: 'menu-outline', flipRtl: true},
],
},

product: [
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
],
};
78 changes: 78 additions & 0 deletions uniquely/soffit-pwa/src/content/product-page-en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* eslint-disable max-len */
import type {ProductPageContent} from '../type.js';

export const productPageContent: ProductPageContent = {
topAppBar: {
type: 'large',
headline: 'Ceiling tile product',
startIcon: {icon: 'arrow-back-outline'},
endIconList: [{icon: 'globe-outline', clickSignalId: 'language-button-click-event'}, {icon: 'menu-outline', flipRtl: true}],
},

product: [
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'Product one',
image: 'image/ceiling_tile.jpg',
description: 'The description text of a product from the Soffit brand',
elevated: 2,
highlight: true,
stated: true,
},
],
};
81 changes: 81 additions & 0 deletions uniquely/soffit-pwa/src/content/product-page-fa.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* eslint-disable max-len */
import type {ProductPageContent} from '../type.js';

export const productPageContent: ProductPageContent = {
topAppBar: {
type: 'large',
headline: 'محصولات تایل سقفی',
startIcon: {icon: 'arrow-back-outline', flipRtl: true},
endIconList: [
{icon: 'globe-outline', clickSignalId: 'language-button-click-event'},
{icon: 'menu-outline', flipRtl: true},
],
},

product: [
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
{
headline: 'محصول شماره یک',
image: 'image/ceiling_tile.jpg',
description: 'متن توضیحات یک محصول از برند سافیت',
elevated: 2,
highlight: true,
stated: true,
},
],
};
16 changes: 8 additions & 8 deletions uniquely/soffit-pwa/src/director/content-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ localeContextConsumer.subscribe(async () => {

const homePageContent =
language === 'en'
? (await import('../content/en.js')).homePageContent
: (await import('../content/fa.js')).homePageContent;
const productPageContent =
language === 'en'
? (await import('../content/en.js')).productPageContent
: (await import('../content/fa.js')).productPageContent;

? (await import('../content/home-page-en.js')).homePageContent
: (await import('../content/home-page-fa.js')).homePageContent;
contextProvider.setValue<PageHomeContent>('home_page_content', homePageContent);
contextProvider.setValue<ProductPageContent>('product_page_content', productPageContent);

const content =
language === 'en'
? (await import('../content/product-page-en.js')).productPageContent
: (await import('../content/product-page-fa.js')).productPageContent;
contextProvider.setValue<ProductPageContent>('product_page_content', content);
});

0 comments on commit 58ed218

Please sign in to comment.