Skip to content

Commit

Permalink
feat(client libs): add routes [WiP]
Browse files Browse the repository at this point in the history
* add router-outlet app.component.html
* add authRoutes => auth.module.ts
* add userProfileRoutes => user-profile.common.ts
* add routes auth & user-profile

VladiRR#38
  • Loading branch information
VladiRR committed Mar 31, 2021
1 parent c964214 commit 72c54a2
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<p>Client app works</p>
<router-outlet></router-outlet>
<!--<svvs-home-page-ui></svvs-home-page-ui>-->

9 changes: 7 additions & 2 deletions libs/frontend/client/feature/auth/src/lib/auth.common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import {Routes} from '@angular/router'
import {AuthUiComponent} from '@svvs/frontend/client/feature/auth'
import {AuthUiComponent} from './auth-ui/auth-ui.component'


export const authRoutes: Routes = []
export const authRoutes: Routes = [
{
path: '',
component: AuthUiComponent
}
]

export const authContainers: any[] = [AuthUiComponent]
4 changes: 3 additions & 1 deletion libs/frontend/client/feature/auth/src/lib/auth.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import {NgModule} from '@angular/core'
import {authContainers} from './auth.common'
import {authContainers, authRoutes} from './auth.common'
import {AuthStoreModule} from '@svvs/frontend/shared/data-access/auth-store'
import {RouterModule} from '@angular/router'

@NgModule({
imports: [
AuthStoreModule.forRoot(),
RouterModule.forChild(authRoutes),
],
exports: [...authContainers],
declarations: [...authContainers],
Expand Down
8 changes: 8 additions & 0 deletions libs/frontend/client/feature/home/src/lib/home.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ export const homeRoutes: Routes = [
{
path: '',
component: HomePageUiComponent
},
{
path: 'auth',
loadChildren: () => import('@svvs/frontend/client/feature/auth').then(m => m.AuthModule)
},
{
path: 'user-profile',
loadChildren: () => import('@svvs/frontend/client/feature/user-profile').then(m => m.UserProfileModule)
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import {Routes} from '@angular/router'
import {UserProfileUiComponent} from './user-profile-ui/user-profile-ui.component'


export const userProfileRoutes: Routes = []
export const userProfileRoutes: Routes = [
{
path: '',
component: UserProfileUiComponent
}
]

export const userProfileContainers: any[] = [UserProfileUiComponent]
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<p>base-layout-ui works!</p>
<svvs-header-ui></svvs-header-ui>
<router-outlet></router-outlet>
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<p>header-ui works!</p>

<svvs-navbar-ui></svvs-navbar-ui>
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
<p>navbar-ui works!</p>
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link" routerLink="/">Главная</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/user-profile">Профиль</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/auth">Войти</a>
</li>
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "ws-style/style";
5 changes: 4 additions & 1 deletion libs/frontend/ui/components/src/lib/navbar/navbar.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import {NgModule} from '@angular/core'
import {navbarContainers} from './navbar.common'
import {RouterModule} from '@angular/router'


@NgModule({
declarations: [...navbarContainers],
exports: [...navbarContainers],
imports: [],
imports: [
RouterModule,
],
})
export class NavbarModule {
}
4 changes: 3 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"frontend-client-feature-user-profile": {
"tags": ["type:lib", "scope:frontend-client", "lib-type:feature"]
},
"frontend-ui-components": { "tags": [] }
"frontend-ui-components": {
"tags": ["type:lib", "scope:frontend-client", "lib-type:ui"]
}
}
}
8 changes: 8 additions & 0 deletions ws-style/shame.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

@import "~bootstrap/scss/nav";


.justify-content-end {
display: flex;
justify-content: flex-end;
}
2 changes: 2 additions & 0 deletions ws-style/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
* Normalize default browser style
*/
@import "base";

@import "shame";

0 comments on commit 72c54a2

Please sign in to comment.