-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RSS-ECOMM-3_25): create pages components (#214)
* feat: add base page components * docs: update PR template * fix: link styles * fix: button naming * Apply suggestions from code review Co-authored-by: Max <[email protected]> --------- Co-authored-by: Max <[email protected]>
- Loading branch information
1 parent
a5d0b7e
commit 61fb5a8
Showing
20 changed files
with
395 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Page } from '@/shared/types/common.ts'; | ||
|
||
import getStore from '@/shared/Store/Store.ts'; | ||
import { setCurrentPage } from '@/shared/Store/actions.ts'; | ||
import { PAGE_ID } from '@/shared/constants/pages.ts'; | ||
|
||
import AboutUsPageView from '../view/AboutUsPageView.ts'; | ||
|
||
class AboutUsPageModel implements Page { | ||
private view: AboutUsPageView; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.view = new AboutUsPageView(parent); | ||
this.init(); | ||
} | ||
|
||
private init(): void { | ||
getStore().dispatch(setCurrentPage(PAGE_ID.ABOUT_US_PAGE)); | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default AboutUsPageModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import styles from './aboutUsPageView.module.scss'; | ||
|
||
class AboutUsPageView { | ||
private page: HTMLDivElement; | ||
|
||
private parent: HTMLDivElement; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.parent = parent; | ||
this.parent.innerHTML = ''; | ||
this.page = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.page = createBaseElement({ | ||
cssClasses: [styles.aboutUsPage], | ||
tag: 'div', | ||
}); | ||
|
||
this.parent.append(this.page); | ||
|
||
return this.page; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.page; | ||
} | ||
} | ||
export default AboutUsPageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.aboutUsPage { | ||
position: relative; | ||
display: block; | ||
padding: 0 var(--small-offset); | ||
animation: show 0.2s ease-out forwards; | ||
} | ||
|
||
@keyframes show { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
display: block; | ||
opacity: 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Page } from '@/shared/types/common.ts'; | ||
|
||
import getStore from '@/shared/Store/Store.ts'; | ||
import { setCurrentPage } from '@/shared/Store/actions.ts'; | ||
import { PAGE_ID } from '@/shared/constants/pages.ts'; | ||
|
||
import CartPageView from '../view/CartPageView.ts'; | ||
|
||
class CartPageModel implements Page { | ||
private view: CartPageView; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.view = new CartPageView(parent); | ||
this.init(); | ||
} | ||
|
||
private init(): void { | ||
getStore().dispatch(setCurrentPage(PAGE_ID.CART_PAGE)); | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default CartPageModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import styles from './cartPageView.module.scss'; | ||
|
||
class CartPageView { | ||
private page: HTMLDivElement; | ||
|
||
private parent: HTMLDivElement; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.parent = parent; | ||
this.parent.innerHTML = ''; | ||
this.page = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.page = createBaseElement({ | ||
cssClasses: [styles.cartPage], | ||
tag: 'div', | ||
}); | ||
|
||
this.parent.append(this.page); | ||
|
||
return this.page; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.page; | ||
} | ||
} | ||
export default CartPageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.cartPage { | ||
position: relative; | ||
display: block; | ||
padding: 0 var(--small-offset); | ||
animation: show 0.2s ease-out forwards; | ||
} | ||
|
||
@keyframes show { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
display: block; | ||
opacity: 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Page } from '@/shared/types/common.ts'; | ||
|
||
import getStore from '@/shared/Store/Store.ts'; | ||
import { setCurrentPage } from '@/shared/Store/actions.ts'; | ||
import { PAGE_ID } from '@/shared/constants/pages.ts'; | ||
|
||
import CatalogPageView from '../view/CatalogPageView.ts'; | ||
|
||
class CatalogPageModel implements Page { | ||
private view: CatalogPageView; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.view = new CatalogPageView(parent); | ||
this.init(); | ||
} | ||
|
||
private init(): void { | ||
getStore().dispatch(setCurrentPage(PAGE_ID.CATALOG_PAGE)); | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default CatalogPageModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import styles from './catalogPageView.module.scss'; | ||
|
||
class CatalogPageView { | ||
private page: HTMLDivElement; | ||
|
||
private parent: HTMLDivElement; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.parent = parent; | ||
this.parent.innerHTML = ''; | ||
this.page = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.page = createBaseElement({ | ||
cssClasses: [styles.catalogPage], | ||
tag: 'div', | ||
}); | ||
|
||
this.parent.append(this.page); | ||
|
||
return this.page; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.page; | ||
} | ||
} | ||
export default CatalogPageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.catalogPage { | ||
position: relative; | ||
display: block; | ||
padding: 0 var(--small-offset); | ||
animation: show 0.2s ease-out forwards; | ||
} | ||
|
||
@keyframes show { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
display: block; | ||
opacity: 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Page } from '@/shared/types/common.ts'; | ||
|
||
import getStore from '@/shared/Store/Store.ts'; | ||
import { setCurrentPage } from '@/shared/Store/actions.ts'; | ||
import { PAGE_ID } from '@/shared/constants/pages.ts'; | ||
|
||
import ItemPageView from '../view/ItemPageView.ts'; | ||
|
||
class ItemPageModel implements Page { | ||
private view: ItemPageView; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.view = new ItemPageView(parent); | ||
this.init(); | ||
} | ||
|
||
private init(): void { | ||
getStore().dispatch(setCurrentPage(PAGE_ID.ITEM_PAGE)); | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default ItemPageModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import styles from './itemPageView.module.scss'; | ||
|
||
class ItemPageView { | ||
private page: HTMLDivElement; | ||
|
||
private parent: HTMLDivElement; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.parent = parent; | ||
this.parent.innerHTML = ''; | ||
this.page = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.page = createBaseElement({ | ||
cssClasses: [styles.itemPage], | ||
tag: 'div', | ||
}); | ||
|
||
this.parent.append(this.page); | ||
|
||
return this.page; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.page; | ||
} | ||
} | ||
export default ItemPageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.itemPage { | ||
position: relative; | ||
display: block; | ||
padding: 0 var(--small-offset); | ||
animation: show 0.2s ease-out forwards; | ||
} | ||
|
||
@keyframes show { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
display: block; | ||
opacity: 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Page } from '@/shared/types/common.ts'; | ||
|
||
import getStore from '@/shared/Store/Store.ts'; | ||
import { setCurrentPage } from '@/shared/Store/actions.ts'; | ||
import { PAGE_ID } from '@/shared/constants/pages.ts'; | ||
|
||
import UserProfilePageView from '../view/UserProfilePageView.ts'; | ||
|
||
class UserProfilePageModel implements Page { | ||
private view: UserProfilePageView; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.view = new UserProfilePageView(parent); | ||
this.init(); | ||
} | ||
|
||
private init(): void { | ||
getStore().dispatch(setCurrentPage(PAGE_ID.USER_PROFILE_PAGE)); | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default UserProfilePageModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import styles from './userProfilePageView.module.scss'; | ||
|
||
class UserProfilePageView { | ||
private page: HTMLDivElement; | ||
|
||
private parent: HTMLDivElement; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.parent = parent; | ||
this.parent.innerHTML = ''; | ||
this.page = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.page = createBaseElement({ | ||
cssClasses: [styles.userProfilePage], | ||
tag: 'div', | ||
}); | ||
|
||
this.parent.append(this.page); | ||
|
||
return this.page; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.page; | ||
} | ||
} | ||
export default UserProfilePageView; |
17 changes: 17 additions & 0 deletions
17
src/pages/UserProfilePage/view/userProfilePageView.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.userProfilePage { | ||
position: relative; | ||
display: block; | ||
padding: 0 var(--small-offset); | ||
animation: show 0.2s ease-out forwards; | ||
} | ||
|
||
@keyframes show { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
display: block; | ||
opacity: 1; | ||
} | ||
} |
Oops, something went wrong.