diff --git a/src/app/App/model/AppModel.ts b/src/app/App/model/AppModel.ts index 628ff41c..08ec96f8 100644 --- a/src/app/App/model/AppModel.ts +++ b/src/app/App/model/AppModel.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-lines-per-function */ import type { Page } from '@/shared/types/common.ts'; import RouterModel from '@/app/Router/model/RouterModel.ts'; @@ -22,10 +23,26 @@ class AppModel { private createRoutes(): Promise Promise>> { const routesMap = { + [PAGE_ID.ABOUT_US_PAGE]: async (): Promise => { + const { default: AbooutUsPageModel } = await import('@/pages/AboutUsPage/model/AboutUsPageModel.ts'); + return new AbooutUsPageModel(this.appView.getHTML()); + }, + [PAGE_ID.CART_PAGE]: async (): Promise => { + const { default: CartPageModel } = await import('@/pages/CartPage/model/CartPageModel.ts'); + return new CartPageModel(this.appView.getHTML()); + }, + [PAGE_ID.CATALOG_PAGE]: async (): Promise => { + const { default: CatalogPageModel } = await import('@/pages/CatalogPage/model/CatalogPageModel.ts'); + return new CatalogPageModel(this.appView.getHTML()); + }, [PAGE_ID.DEFAULT_PAGE]: async (): Promise => { const { default: MainPageModel } = await import('@/pages/MainPage/model/MainPageModel.ts'); return new MainPageModel(this.appView.getHTML()); }, + [PAGE_ID.ITEM_PAGE]: async (): Promise => { + const { default: ItemPageModel } = await import('@/pages/ItemPage/model/ItemPageModel.ts'); + return new ItemPageModel(this.appView.getHTML()); + }, [PAGE_ID.LOGIN_PAGE]: async (): Promise => { const { default: LoginPageModel } = await import('@/pages/LoginPage/model/LoginPageModel.ts'); return new LoginPageModel(this.appView.getHTML(), this.router); @@ -44,6 +61,10 @@ class AppModel { ); return new RegistrationPageModel(this.appView.getHTML(), this.router); }, + [PAGE_ID.USER_PROFILE_PAGE]: async (): Promise => { + const { default: UserProfilePageModel } = await import('@/pages/UserProfilePage/model/UserProfilePageModel.ts'); + return new UserProfilePageModel(this.appView.getHTML()); + }, }; const routes = new Map Promise>();