Skip to content

Commit

Permalink
fix(keep-pwa): review issue
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed May 12, 2023
1 parent 40725d4 commit 9d6d03c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
3 changes: 3 additions & 0 deletions uniquely/keep-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "Alwatr Keep PWA.",
"type": "module",
"author": "S. Ali Mihandoost <[email protected]> (https://ali.mihandoost.com)",
"contributors": [
"S. Amir Mohammad Najafi <[email protected]> (https://njfamirm.ir)"
],
"private": true,
"engines": {
"node": ">=18.13.0",
Expand Down
10 changes: 7 additions & 3 deletions uniquely/keep-pwa/src/content/home-page-en.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-len */
import {languageButtonClickEventListener} from '../manager/context.js';

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

Expand All @@ -7,15 +8,18 @@ export const homePageContent: PageHomeContent = {
type: 'center',
headline: 'Keep Collection',
startIcon: {icon: 'menu-outline', flipRtl: true},
endIconList: [{icon: 'globe-outline', clickSignalId: 'language-button-click-event'}],
endIconList: [{icon: 'globe-outline', clickSignalId: languageButtonClickEventListener.id}],
},
about: {
elevated: 1,
stated: true,
wide: true,
headline: 'About Us',
description:
'Keep is an Iranian holding company in the field of building materials and stone veneer manufacturing. It is engaged in the production and distribution of construction services. The factory operates with the aim of distributing construction products in Iranian and international markets. The products produced by this collection are of high quality and are accompanied by experienced staff committed to customer satisfaction.',
slot: `
Keep is an Iranian holding company in the field of building materials and stone veneer manufacturing. It is engaged in the production and distribution of construction services.<br />
The factory operates with the aim of distributing construction products in Iranian and international markets.<br />
The products produced by this collection are of high quality and are accompanied by experienced staff committed to customer satisfaction.
`,
},
product: {
elevated: 1,
Expand Down
10 changes: 8 additions & 2 deletions uniquely/keep-pwa/src/content/home-page-fa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@

import {replaceNumber} from '@alwatr/i18n';

import {languageButtonClickEventListener} from '../manager/context.js';

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

export const homePageContent: PageHomeContent = {
topAppBar: {
type: 'center',
headline: 'مجموعه کیپ',
startIcon: {icon: 'menu-outline', flipRtl: true},
endIconList: [{icon: 'globe-outline', clickSignalId: 'language-button-click-event'}],
endIconList: [{icon: 'globe-outline', clickSignalId: languageButtonClickEventListener.id}],
},
about: {
elevated: 1,
stated: true,
wide: true,
headline: 'درباره ما',
description: 'شرکت تولیدی keep مصالح ساختمانی و اسکوپ سنگ‌نما هلدینگی ایرانی است که در زمینه تولید و توزیع خدمات ساختمانی فعالیت دارد. این کارخانه با هدف توزیع محصولات ساختمانی در بازارهای ایرانی و خارجی مشغول به فعالیت می‌باشد. محصولات تولیدی این مجموعه با کیفیت بالا و کادری مجرب و تعهد به اصول جلب رضایت مشتری می‌باشد.',
slot: `
شرکت تولیدی Keep مصالح ساختمانی و اسکوپ سنگ‌نما هلدینگی ایرانی است که در زمینه تولید و توزیع خدمات ساختمانی فعالیت دارد.<br />
این کارخانه با هدف توزیع محصولات ساختمانی در بازارهای ایرانی و خارجی مشغول به فعالیت می‌باشد.<br />
محصولات تولیدی این مجموعه با کیفیت بالا و کادری مجرب و تعهد به اصول جلب رضایت مشتری می‌باشد.
`,
},
product: {
elevated: 1,
Expand Down
6 changes: 3 additions & 3 deletions uniquely/keep-pwa/src/manager/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import type {ClickSignalType} from '@alwatr/type';
export * from '@alwatr/pwa-helper/context.js';

export const homePageContentContextProvider =
contextProvider.bind<PageHomeContent>('home-page-content-context');
contextProvider.bind<PageHomeContent>('home_page_content_context');
export const homePageContentContextConsumer =
contextConsumer.bind<PageHomeContent>(homePageContentContextProvider.id);

export const languageButtonClickEventListener = eventListener.bind<ClickSignalType>('language-button-click-event');
export const languageButtonClickEventListener = eventListener.bind<ClickSignalType>('language_button_click_event');

export const submitFormCommandTrigger = commandTrigger.bind<FormData, boolean>('submit-form-command');
export const submitFormCommandTrigger = commandTrigger.bind<FormData, boolean>('submit_form_command');
2 changes: 1 addition & 1 deletion uniquely/keep-pwa/src/ui/page/404.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare global {
}

/**
* Alwatr Demo Home Page
* Alwatr 404 Page
*/
@customElement('alwatr-page-404')
export class AlwatrPage404 extends UnresolvedMixin(LocalizeMixin(SignalMixin(AlwatrBaseElement))) {
Expand Down
7 changes: 2 additions & 5 deletions uniquely/keep-pwa/src/ui/page/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
mapIterable,
UnresolvedMixin,
} from '@alwatr/element';
import {localeContextConsumer, message} from '@alwatr/i18n';
import {message} from '@alwatr/i18n';
import '@alwatr/ui-kit/card/icon-box.js';

import {homePageContentContextConsumer, topAppBarContextProvider} from '../../manager/context.js';
Expand Down Expand Up @@ -74,15 +74,12 @@ export class AlwatrPageHome extends UnresolvedMixin(SignalMixin(AlwatrBaseElemen
}

protected* _menuTemplate(): unknown {
yield html`<img class="logo" src="image/keep.svg" alt="Keep Company Logo" />`;
yield html`<img class="logo" src="image/keep.svg" alt="Keep Collection Logo" />`;
yield this._boxTemplate(this?.content?.about);
yield this._boxTemplate(this?.content?.product);
yield html`<alwatr-collaboration-box></alwatr-collaboration-box>`;
yield this._boxTemplate(this?.content?.catalogue);
yield mapIterable(this, this?.content?.socialList, this._boxTemplate, message('loading'));
if (localeContextConsumer.getValue()?.language === 'fa') {
yield this._boxTemplate(this?.content?.agency as BoxType);
}
}

protected _boxTemplate(box?: BoxType): unknown {
Expand Down

0 comments on commit 9d6d03c

Please sign in to comment.