refactor(routes): simplify component loading syntax
This commit is contained in:
parent
f88795f7c5
commit
e5f8d6ce10
5 changed files with 46 additions and 53 deletions
|
@ -14,75 +14,68 @@ export const routes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'verify',
|
||||
loadComponent: () =>
|
||||
import('./feature/auth/verify-email/verify-email.component').then(
|
||||
(m) => m.VerifyEmailComponent
|
||||
),
|
||||
loadComponent: () => import('./feature/auth/verify-email/verify-email.component'),
|
||||
},
|
||||
{
|
||||
path: 'recover-password',
|
||||
loadComponent: () =>
|
||||
import('./feature/auth/recover-password/recover-password.component').then(
|
||||
(m) => m.RecoverPasswordComponent
|
||||
),
|
||||
loadComponent: () => import('./feature/auth/recover-password/recover-password.component'),
|
||||
},
|
||||
{
|
||||
path: 'reset-password',
|
||||
loadComponent: () =>
|
||||
import('./feature/auth/recover-password/recover-password.component').then(
|
||||
(m) => m.RecoverPasswordComponent
|
||||
),
|
||||
loadComponent: () => import('./feature/auth/recover-password/recover-password.component'),
|
||||
},
|
||||
{
|
||||
path: 'oauth2/callback',
|
||||
children: [
|
||||
{
|
||||
path: 'github',
|
||||
loadComponent: () =>
|
||||
import('./feature/auth/oauth2/oauth2-callback.component').then(
|
||||
(m) => m.OAuth2CallbackComponent
|
||||
),
|
||||
loadComponent: () => import('./feature/auth/oauth2/oauth2-callback.component'),
|
||||
data: { provider: 'github' },
|
||||
},
|
||||
{
|
||||
path: 'google',
|
||||
loadComponent: () =>
|
||||
import('./feature/auth/oauth2/oauth2-callback.component').then(
|
||||
(m) => m.OAuth2CallbackComponent
|
||||
),
|
||||
loadComponent: () => import('./feature/auth/oauth2/oauth2-callback.component'),
|
||||
data: { provider: 'google' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'game/blackjack',
|
||||
loadComponent: () => import('./feature/game/blackjack/blackjack.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'game/coinflip',
|
||||
loadComponent: () => import('./feature/game/coinflip/coinflip.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'game/slots',
|
||||
loadComponent: () => import('./feature/game/slots/slots.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'game/lootboxes',
|
||||
loadComponent: () =>
|
||||
import('./feature/lootboxes/lootbox-selection/lootbox-selection.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'game/lootboxes/open/:id',
|
||||
loadComponent: () => import('./feature/lootboxes/lootbox-opening/lootbox-opening.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'game/dice',
|
||||
loadComponent: () => import('./feature/game/dice/dice.component').then((m) => m.DiceComponent),
|
||||
canActivate: [authGuard],
|
||||
path: 'game',
|
||||
children: [
|
||||
{
|
||||
path: 'blackjack',
|
||||
loadComponent: () => import('./feature/game/blackjack/blackjack.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'coinflip',
|
||||
loadComponent: () => import('./feature/game/coinflip/coinflip.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'slots',
|
||||
loadComponent: () => import('./feature/game/slots/slots.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
{
|
||||
path: 'lootboxes',
|
||||
loadComponent: () =>
|
||||
import('./feature/lootboxes/lootbox-selection/lootbox-selection.component'),
|
||||
canActivate: [authGuard],
|
||||
children: [
|
||||
{
|
||||
path: 'open/:id',
|
||||
loadComponent: () =>
|
||||
import('./feature/lootboxes/lootbox-opening/lootbox-opening.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'dice',
|
||||
loadComponent: () => import('./feature/game/dice/dice.component'),
|
||||
canActivate: [authGuard],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
Reference in a new issue