From afe76781dbee4bf8b8caec441dabefef2e7944f7 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Wed, 25 Nov 2020 22:10:50 +0100 Subject: [PATCH] added actual basic snackbar --- src/app/app.module.ts | 2 ++ .../sidenav-profile/sidenav-profile.component.html | 8 +++++--- .../sidenav-profile/sidenav-profile.component.ts | 7 ++++++- src/app/services/auth.service.ts | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 73cabde..4493791 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -51,6 +51,7 @@ import { EquipmentTypesComponent } from './pages/tables/equipment-types/equipmen import { EngagementTypesComponent } from './pages/tables/engagement-types/engagement-types.component'; import { WorkshopsComponent } from './pages/tables/workshops/workshops.component'; import { ReferenceTableComponent } from './components/reference-table/reference-table.component' +import { MatSnackBarModule } from '@angular/material/snack-bar'; @NgModule({ @@ -96,6 +97,7 @@ import { ReferenceTableComponent } from './components/reference-table/reference- MatProgressSpinnerModule, MatProgressBarModule, MatCheckboxModule, + MatSnackBarModule, GraphQLModule, DragDropModule, MatTooltipModule, diff --git a/src/app/components/sidenav-profile/sidenav-profile.component.html b/src/app/components/sidenav-profile/sidenav-profile.component.html index 8e8db75..832786d 100644 --- a/src/app/components/sidenav-profile/sidenav-profile.component.html +++ b/src/app/components/sidenav-profile/sidenav-profile.component.html @@ -1,3 +1,5 @@ - -

{{name}}

-

{{email}}

\ No newline at end of file +
+ +

{{name}}

+

{{email}}

+
\ No newline at end of file diff --git a/src/app/components/sidenav-profile/sidenav-profile.component.ts b/src/app/components/sidenav-profile/sidenav-profile.component.ts index 68739a0..3b14530 100644 --- a/src/app/components/sidenav-profile/sidenav-profile.component.ts +++ b/src/app/components/sidenav-profile/sidenav-profile.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { AuthService } from '../../services/auth.service'; +import { SnackBarService } from '../../services/snackbar.service'; @Component({ selector: 'sidenav-profile', @@ -11,7 +12,7 @@ export class SidenavProfileComponent implements OnInit { email: String; profileURL: String; - constructor( private auth: AuthService) { } + constructor( private auth: AuthService, private snackBar: SnackBarService) { } ngOnInit() { this.auth.currentUser.subscribe(user => { @@ -23,4 +24,8 @@ export class SidenavProfileComponent implements OnInit { } }); } + + testSnackBar(){ + this.snackBar.openSnackBar("A user administration will be found here", "Ok"); + } } \ No newline at end of file diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 457af4c..975b2e6 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -5,6 +5,7 @@ import { environment } from '../../environments/environment'; import { Observable, BehaviorSubject, of } from 'rxjs'; import { User } from "../models/user"; + @Injectable({ providedIn: 'root', })