WiP (really fuckin alpha version sidenav)

urls
FlayInAHook 4 years ago
parent 036a9d27f1
commit df3aaad063

@ -1,6 +1,6 @@
<div id="page-wrapper"> <div id="page-wrapper">
<mat-toolbar id="navbar"> <mat-toolbar id="navbar">
<button mat-icon-button (click)="sidenav.toggle()" *ngIf="loggedIn"> <button mat-icon-button (click)="navService.openNav()" *ngIf="loggedIn">
<mat-icon>menu</mat-icon> <mat-icon>menu</mat-icon>
</button> </button>
<span>fLotte</span> <span>fLotte</span>
@ -28,19 +28,19 @@
</mat-toolbar> </mat-toolbar>
<mat-sidenav-container id="content"> <mat-sidenav-container id="content">
<!--<mat-sidenav #appDrawer mode="over" opened="false"> <mat-sidenav #appDrawer mode="over" opened="false">
<mat-nav-list> <mat-nav-list>
<app-menu-list-item *ngFor="let item of navItems" [item]="item"></app-menu-list-item> <app-menu-list-item *ngFor="let item of navItems" [item]="item"></app-menu-list-item>
</mat-nav-list> </mat-nav-list>
</mat-sidenav>--> </mat-sidenav>
<mat-sidenav #sidenav> <!--<mat-sidenav #sidenav>
<mat-nav-list (click)="sidenav.toggle()"> <mat-nav-list (click)="sidenav.toggle()">
<a mat-list-item [routerLink]="'/tableOverview'"> Tabellenübersicht </a> <a mat-list-item [routerLink]="'/tableOverview'"> Tabellenübersicht </a>
<a mat-list-item [routerLink]="'/table/bikes'"> Lastenräder </a> <a mat-list-item [routerLink]="'/table/bikes'"> Lastenräder </a>
<a mat-list-item [routerLink]="'/table/participants'"> Beteiligte </a> <a mat-list-item [routerLink]="'/table/participants'"> Beteiligte </a>
<a mat-list-item [routerLink]="'/table/lendingStations'"> Ausleihstationen </a> <a mat-list-item [routerLink]="'/table/lendingStations'"> Ausleihstationen </a>
</mat-nav-list> </mat-nav-list>
</mat-sidenav> </mat-sidenav>-->
<mat-sidenav-content> <mat-sidenav-content>
<router-outlet></router-outlet> <router-outlet></router-outlet>
</mat-sidenav-content> </mat-sidenav-content>

@ -5,6 +5,7 @@ import { Router } from '@angular/router';
import { ViewChild } from '@angular/core'; import { ViewChild } from '@angular/core';
import { MatSidenav } from '@angular/material/sidenav'; import { MatSidenav } from '@angular/material/sidenav';
import { NavService } from './components/menu-list-item/nav.service'; import { NavService } from './components/menu-list-item/nav.service';
import { NavItem } from './components/menu-list-item/nav-item';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
@ -19,6 +20,35 @@ export class AppComponent {
@ViewChild('sidenav') public sideNav:MatSidenav; @ViewChild('sidenav') public sideNav:MatSidenav;
@ViewChild('appDrawer') appDrawer: ElementRef; @ViewChild('appDrawer') appDrawer: ElementRef;
navItems: NavItem[] = [
{
displayName: 'Tabellenübersicht ',
iconName: 'recent_actors',
route: 'tableOverview'
},
{
displayName: 'Tabellen',
iconName: 'recent_actors',
children: [
{
displayName: 'Lastenräder',
iconName: 'group',
route: 'table/bikes'
},
{
displayName: 'Beteiligte',
iconName: 'group',
route: 'table/participants'
},
{
displayName: 'Ausleihstationen',
iconName: 'group',
route: 'table/lendingStations'
}]
}];
constructor( constructor(
private renderer: Renderer2, private renderer: Renderer2,
private themeService: ColorThemeService, private themeService: ColorThemeService,

@ -1,4 +1,4 @@
/*@import '../theme'; @import '../../../theme';
:host { :host {
display: flex; display: flex;
@ -7,12 +7,12 @@
width: 100%; width: 100%;
.mat-list-item.active { .mat-list-item.active {
background-color: mat-color($app-primary, 50); //background-color: mat-color($dark-primary, 50);
} }
&:hover, &:hover,
&:focus { &:focus {
>.mat-list-item:not(.expanded) { >.mat-list-item:not(.expanded) {
background-color: mat-color($app-primary, 100) !important; //background-color: mat-color($dark-primary, 100) !important;
} }
} }
} }
@ -25,4 +25,4 @@
.routeIcon { .routeIcon {
margin-right: 40px; margin-right: 40px;
} }
}*/ }

Loading…
Cancel
Save