2026-01-18 18:57:06 +04:00
|
|
|
import { Routes } from '@angular/router';
|
2026-02-26 22:23:08 +04:00
|
|
|
import { languageGuard } from './guards/language.guard';
|
2026-01-18 18:57:06 +04:00
|
|
|
|
2026-01-23 00:00:08 +04:00
|
|
|
// Core routes (same across all brands)
|
|
|
|
|
const coreRoutes: Routes = [
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
|
|
|
|
path: '',
|
|
|
|
|
loadComponent: () => import('./pages/home/home.component').then(m => m.HomeComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'category/:id',
|
|
|
|
|
loadComponent: () => import('./pages/category/subcategories.component').then(m => m.SubcategoriesComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'category/:id/items',
|
|
|
|
|
loadComponent: () => import('./pages/category/category.component').then(m => m.CategoryComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'item/:id',
|
|
|
|
|
loadComponent: () => import('./pages/item-detail/item-detail.component').then(m => m.ItemDetailComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'search',
|
|
|
|
|
loadComponent: () => import('./pages/search/search.component').then(m => m.SearchComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'cart',
|
|
|
|
|
loadComponent: () => import('./pages/cart/cart.component').then(m => m.CartComponent)
|
2026-07-03 01:38:26 +04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'platform',
|
|
|
|
|
loadComponent: () => import('./pages/public/platform-home.component').then(m => m.PlatformHomeComponent)
|
2026-07-03 01:40:01 +04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'builder-sandbox',
|
|
|
|
|
loadComponent: () => import('./pages/builder/builder-sandbox.component').then(m => m.BuilderSandboxComponent)
|
2026-07-03 01:41:37 +04:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'backoffice-sandbox',
|
|
|
|
|
loadComponent: () => import('./pages/backoffice/backoffice-dashboard.component').then(m => m.BackofficeDashboardComponent)
|
2026-01-23 00:00:08 +04:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
2026-07-03 01:55:23 +04:00
|
|
|
const infoRoutes: Routes = [
|
|
|
|
|
{
|
|
|
|
|
path: 'about',
|
|
|
|
|
loadComponent: () => import('./pages/info/about/about.component').then(m => m.AboutComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'contacts',
|
|
|
|
|
loadComponent: () => import('./pages/info/contacts/contacts.component').then(m => m.ContactsComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'faq',
|
|
|
|
|
loadComponent: () => import('./pages/info/faq/faq.component').then(m => m.FaqComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'delivery',
|
|
|
|
|
loadComponent: () => import('./pages/info/delivery/delivery.component').then(m => m.DeliveryComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'guarantee',
|
|
|
|
|
loadComponent: () => import('./pages/info/guarantee/guarantee.component').then(m => m.GuaranteeComponent)
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const legalRoutes: Routes = [
|
|
|
|
|
{
|
|
|
|
|
path: 'company-details',
|
|
|
|
|
loadComponent: () => import('./pages/legal/company-details/company-details.component').then(m => m.CompanyDetailsComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'payment-terms',
|
|
|
|
|
loadComponent: () => import('./pages/legal/payment-terms/payment-terms.component').then(m => m.PaymentTermsComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'return-policy',
|
|
|
|
|
loadComponent: () => import('./pages/legal/return-policy/return-policy.component').then(m => m.ReturnPolicyComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'public-offer',
|
|
|
|
|
loadComponent: () => import('./pages/legal/public-offer/public-offer.component').then(m => m.PublicOfferComponent)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'privacy-policy',
|
|
|
|
|
loadComponent: () => import('./pages/legal/privacy-policy/privacy-policy.component').then(m => m.PrivacyPolicyComponent)
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
2026-02-26 22:23:08 +04:00
|
|
|
// All routes sit under a :lang prefix (e.g. /ru/cart, /en/item/5)
|
2026-01-23 00:00:08 +04:00
|
|
|
export const routes: Routes = [
|
2026-01-18 18:57:06 +04:00
|
|
|
{
|
2026-02-26 22:23:08 +04:00
|
|
|
path: ':lang',
|
|
|
|
|
canActivate: [languageGuard],
|
|
|
|
|
children: [
|
|
|
|
|
...coreRoutes,
|
2026-07-03 01:55:23 +04:00
|
|
|
...infoRoutes,
|
|
|
|
|
...legalRoutes,
|
2026-02-26 22:23:08 +04:00
|
|
|
{ path: '**', redirectTo: '' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
// URLs without a language prefix → redirect to default language
|
|
|
|
|
{ path: '**', redirectTo: 'ru' }
|
2026-01-23 00:00:08 +04:00
|
|
|
];
|