]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/app-routing.module.ts
Make video-add-nav tabs scrollable on small devices (#2677)
[github/Chocobozzz/PeerTube.git] / client / src / app / app-routing.module.ts
CommitLineData
df98563e 1import { NgModule } from '@angular/core'
489290b8 2import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router'
a685e25c
C
3
4import { PreloadSelectedModulesList } from './core'
b889cdb2 5import { AppComponent } from '@app/app.component'
489290b8 6import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
3b20bdd6 7import { MenuGuards } from '@app/core/routing/menu-guard.service'
693b1aba
C
8
9const routes: Routes = [
4b4f22fc
C
10 {
11 path: 'admin',
3b20bdd6
RK
12 canActivate: [ MenuGuards.close() ],
13 canDeactivate: [ MenuGuards.open() ],
f36da21e 14 loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule)
4b4f22fc
C
15 },
16 {
17 path: 'my-account',
f36da21e 18 loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule)
4b4f22fc 19 },
d9eaee39
JM
20 {
21 path: 'verify-account',
f36da21e 22 loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule)
d9eaee39 23 },
4b4f22fc
C
24 {
25 path: 'accounts',
f36da21e 26 loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule)
4b4f22fc
C
27 },
28 {
29 path: 'video-channels',
f36da21e 30 loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule)
a51bad1a 31 },
78f912ed
C
32 {
33 path: 'about',
f36da21e 34 loadChildren: () => import('./+about/about.module').then(m => m.AboutModule)
78f912ed 35 },
b247a132
C
36 {
37 path: 'signup',
f36da21e 38 loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule)
b247a132 39 },
b889cdb2
C
40 {
41 path: '',
42 component: AppComponent // Avoid 404, app component will redirect dynamically
43 },
a51bad1a
C
44 {
45 path: '**',
f36da21e 46 loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule)
4b4f22fc 47 }
df98563e 48]
693b1aba
C
49
50@NgModule({
04de542a
C
51 imports: [
52 RouterModule.forRoot(routes, {
53 useHash: Boolean(history.pushState) === false,
489290b8 54 scrollPositionRestoration: 'disabled',
07a98236 55 preloadingStrategy: PreloadSelectedModulesList,
489290b8 56 anchorScrolling: 'disabled'
04de542a
C
57 })
58 ],
901637bb 59 providers: [
3b20bdd6 60 MenuGuards.guards,
489290b8
C
61 PreloadSelectedModulesList,
62 { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
901637bb 63 ],
693b1aba
C
64 exports: [ RouterModule ]
65})
66export class AppRoutingModule {}