|
1 | | - |
2 | | -import { Routes } from '@angular/router'; |
3 | | -import { AboutComponent } from './pages/about/about.component'; |
4 | | -import { AuthComponent } from './pages/auth/auth.component'; |
5 | | -import { DashboardComponent } from './pages/dashboard/dashboard.component'; |
6 | | -import { GalleryComponent } from './pages/gallery/gallery.component'; |
7 | | -import { PortfolioPageComponent } from './pages/portfolio/portfolio.component'; |
8 | | -import { ServicesCatalogComponent } from './pages/services-catalog/services-catalog.component'; |
9 | | -import { ServicesPageComponent } from './pages/services/services.component'; |
10 | | -import { SettingsComponent } from './pages/settings/settings.component'; |
11 | | -import { UserHomeComponent } from './pages/user-home/user-home.component'; |
12 | | -import { UserProfileComponent } from './pages/user-profile/user-profile.component'; |
13 | | -import { VeilPageComponent } from './pages/veil/veil.component'; |
14 | | -import { VeilsCatalogComponent } from './pages/veils-catalog/veils-catalog.component'; |
15 | | -import { AdminLayoutComponent } from './widgets/layouts/admin-layout.component'; |
16 | | -import { UserLayoutComponent } from './widgets/layouts/user-layout.component'; |
17 | | -import { adminGuard } from './app/core/guards/admin.guard'; |
| 1 | +import { Routes } from "@angular/router"; |
| 2 | +import { AboutComponent } from "@pages/about"; |
| 3 | +import { AuthComponent } from "@pages/auth"; |
| 4 | +import { DashboardComponent } from "@pages/dashboard"; |
| 5 | +import { GalleryComponent } from "@pages/gallery"; |
| 6 | +import { PortfolioPageComponent } from "@pages/portfolio"; |
| 7 | +import { ServicesCatalogComponent } from "@pages/services-catalog"; |
| 8 | +import { ServicesPageComponent } from "@pages/services"; |
| 9 | +import { SettingsComponent } from "@pages/settings"; |
| 10 | +import { UserHomeComponent } from "@pages/user-home"; |
| 11 | +import { UserProfileComponent } from "@pages/user-profile"; |
| 12 | +import { VeilPageComponent } from "@pages/veil"; |
| 13 | +import { VeilsCatalogComponent } from "@pages/veils-catalog"; |
| 14 | +import { AdminLayoutComponent } from "@widgets/layouts"; |
| 15 | +import { UserLayoutComponent } from "@widgets/layouts"; |
| 16 | +import { adminGuard } from "@core/guards"; |
18 | 17 |
|
19 | 18 | export const routes: Routes = [ |
20 | | - { path: '', redirectTo: 'user/home', pathMatch: 'full' }, |
21 | | - { path: 'auth', component: AuthComponent }, |
22 | | - |
| 19 | + { path: "", redirectTo: "user/home", pathMatch: "full" }, |
| 20 | + { path: "auth", component: AuthComponent }, |
| 21 | + |
23 | 22 | // Admin Routes |
24 | | - { |
25 | | - path: 'admin', |
| 23 | + { |
| 24 | + path: "admin", |
26 | 25 | component: AdminLayoutComponent, |
27 | 26 | // canActivate: [adminGuard], |
28 | 27 | children: [ |
29 | | - { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, |
30 | | - { path: 'dashboard', loadComponent: () => import('./pages/dashboard/dashboard.component').then(m => m.DashboardComponent) }, |
31 | | - { path: 'veil', component: VeilPageComponent }, |
32 | | - { path: 'services', component: ServicesPageComponent }, |
33 | | - { path: 'clients', component: DashboardComponent }, |
34 | | - { path: 'gallery', component: GalleryComponent }, |
35 | | - { path: 'settings', component: SettingsComponent }, |
36 | | - ] |
| 28 | + { path: "", redirectTo: "dashboard", pathMatch: "full" }, |
| 29 | + { |
| 30 | + path: "dashboard", |
| 31 | + loadComponent: () => |
| 32 | + import("./pages/dashboard/dashboard.component").then( |
| 33 | + (m) => m.DashboardComponent, |
| 34 | + ), |
| 35 | + }, |
| 36 | + { path: "veil", component: VeilPageComponent }, |
| 37 | + { path: "services", component: ServicesPageComponent }, |
| 38 | + { path: "clients", component: DashboardComponent }, |
| 39 | + { path: "gallery", component: GalleryComponent }, |
| 40 | + { path: "settings", component: SettingsComponent }, |
| 41 | + ], |
37 | 42 | }, |
38 | 43 |
|
39 | 44 | // User Routes |
40 | 45 | { |
41 | | - path: 'user', |
| 46 | + path: "user", |
42 | 47 | component: UserLayoutComponent, |
43 | 48 | children: [ |
44 | | - { path: '', redirectTo: 'home', pathMatch: 'full' }, |
45 | | - { path: 'home', loadComponent: () => import('./pages/user-home/user-home.component').then(m => m.UserHomeComponent) }, |
46 | | - { path: 'collection', loadComponent: () => import('./pages/veils-catalog/veils-catalog.component').then(m => m.VeilsCatalogComponent) }, |
47 | | - { path: 'services', loadComponent: () => import('./pages/services-catalog/services-catalog.component').then(m => m.ServicesCatalogComponent) }, |
48 | | - { path: 'portfolio', loadComponent: () => import('./pages/portfolio/portfolio.component').then(m => m.PortfolioPageComponent) }, |
49 | | - { path: 'about', loadComponent: () => import('./pages/about/about.component').then(m => m.AboutComponent) }, |
50 | | - { path: 'profile', loadComponent: () => import('./pages/user-profile/user-profile.component').then(m => m.UserProfileComponent) } |
51 | | - ] |
| 49 | + { path: "", redirectTo: "home", pathMatch: "full" }, |
| 50 | + { |
| 51 | + path: "home", |
| 52 | + loadComponent: () => |
| 53 | + import("@pages/user-home").then((m) => m.UserHomeComponent), |
| 54 | + }, |
| 55 | + { |
| 56 | + path: "collection", |
| 57 | + loadComponent: () => |
| 58 | + import("@pages/veils-catalog").then((m) => m.VeilsCatalogComponent), |
| 59 | + }, |
| 60 | + { |
| 61 | + path: "services", |
| 62 | + loadComponent: () => |
| 63 | + import("@pages/services-catalog").then( |
| 64 | + (m) => m.ServicesCatalogComponent, |
| 65 | + ), |
| 66 | + }, |
| 67 | + { |
| 68 | + path: "portfolio", |
| 69 | + loadComponent: () => |
| 70 | + import("@pages/portfolio").then((m) => m.PortfolioPageComponent), |
| 71 | + }, |
| 72 | + { |
| 73 | + path: "about", |
| 74 | + loadComponent: () => |
| 75 | + import("@pages/about").then((m) => m.AboutComponent), |
| 76 | + }, |
| 77 | + { |
| 78 | + path: "profile", |
| 79 | + loadComponent: () => |
| 80 | + import("@pages/user-profile").then((m) => m.UserProfileComponent), |
| 81 | + }, |
| 82 | + ], |
52 | 83 | }, |
53 | 84 |
|
54 | | - { path: '**', redirectTo: 'user/home' } |
| 85 | + { path: "**", redirectTo: "user/home" }, |
55 | 86 | ]; |
0 commit comments