Skip to content

Commit

Permalink
refactor: remove sidenav menu
Browse files Browse the repository at this point in the history
  • Loading branch information
grantwforsythe committed Mar 13, 2024
1 parent 2156fe9 commit 383a9da
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 69 deletions.
99 changes: 34 additions & 65 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,67 +1,36 @@
<mat-sidenav-container fullscreen>
<mat-sidenav #sidenav (click)="sidenav.close()">
<mat-nav-list>
@if (auth.isAuthenticated()) {
<a mat-list-item [routerLink]="['budgets']">
<mat-icon>library_books</mat-icon>
<span>Budgets</span>
</a>
<header>
<mat-toolbar>
<a mat-button [routerLink]="['budgets']" aria-label="YNAB Custom Reports">
<img
matButtonIcon
aria-hidden="true"
alt="ynab-custom-reports"
src="../assets/images/charts.svg"
/>
</a>
<span>Custom Reports for YNAB</span>
<span class="spacer"></span>
<app-login></app-login>
</mat-toolbar>
</header>

<a mat-list-item (click)="auth.logout()" (keyup)="auth.logout()" aria-disabled="true">
<mat-icon>exit_to_app</mat-icon>
<span>Logout</span>
</a>
} @else {
<a
mat-list-item
(click)="auth.authenticate()"
(keyup)="auth.authenticate()"
aria-disabled="true"
>
<mat-icon>login</mat-icon>
<span>Authenticate</span>
</a>
}
</mat-nav-list>
</mat-sidenav>
<main>
<router-outlet></router-outlet>
</main>

<header>
<mat-toolbar>
<!-- <button mat-icon-button (click)="sidenav.open('mouse')">
<mat-icon>menu</mat-icon>
</button> -->
<a mat-button [routerLink]="['budgets']" aria-label="YNAB Custom Reports">
<img
matButtonIcon
aria-hidden="true"
alt="ynab-custom-reports"
src="../assets/images/charts.svg"
/>
</a>
<span>Custom Reports for YNAB</span>
<span class="spacer"></span>
<app-login></app-login>
</mat-toolbar>
</header>

<main>
<router-outlet></router-outlet>
</main>

<footer>
<div class="container">
<a
mat-button
href="https://github.com/grantwforsythe/ynab-custom-reports"
aria-label="GitHub Repository"
>
<img
matButtonIcon
aria-hidden="true"
alt="ynab-custom-reports"
src="../assets/images/github.svg"
/>
</a>
</div>
</footer>
</mat-sidenav-container>
<footer>
<div class="container">
<a
mat-button
href="https://github.com/grantwforsythe/ynab-custom-reports"
aria-label="GitHub Repository"
>
<img
matButtonIcon
aria-hidden="true"
alt="ynab-custom-reports"
src="../assets/images/github.svg"
/>
</a>
</div>
</footer>
4 changes: 0 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { RouterModule, RouterOutlet } from '@angular/router';
import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
import { MatDividerModule } from '@angular/material/divider';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatListModule } from '@angular/material/list';
import { MatToolbarModule } from '@angular/material/toolbar';
import { AuthService } from './services/auth/auth.service';

Expand All @@ -20,8 +18,6 @@ import { AuthService } from './services/auth/auth.service';
LoginComponent,
MatIconModule,
MatDividerModule,
MatSidenavModule,
MatListModule,
MatToolbarModule,
],
templateUrl: './app.component.html',
Expand Down

0 comments on commit 383a9da

Please sign in to comment.