From 5d10d57e502ecaa9afe5ddc9ba5eadf5d41b16c1 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Thu, 3 Dec 2020 00:20:43 +0100 Subject: [PATCH] made the snackbar prettier --- src/app/pages/profile/profile.component.ts | 2 +- src/app/services/snackbar.service.ts | 2 +- src/styles.scss | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/pages/profile/profile.component.ts b/src/app/pages/profile/profile.component.ts index 3a13c04..ad1e845 100644 --- a/src/app/pages/profile/profile.component.ts +++ b/src/app/pages/profile/profile.component.ts @@ -65,7 +65,7 @@ export class ProfileComponent implements OnInit { .updateUser(user) .subscribe( data => { - this.snackBar.openSnackBar("Das Passwort wurde erfolgreich aktualisiert"); + this.snackBar.openSnackBar("Das Passwort wurde erfolgreich aktualisiert", "Ok"); console.log(JSON.stringify(data)); }, (error) => { diff --git a/src/app/services/snackbar.service.ts b/src/app/services/snackbar.service.ts index 7c7fcfa..f1e829a 100644 --- a/src/app/services/snackbar.service.ts +++ b/src/app/services/snackbar.service.ts @@ -12,7 +12,7 @@ export class SnackBarService { openSnackBar(message: string, action: string = "") { this.snackBar.open(message, action, { duration: 5000, - panelClass: ['mat-toolbar', 'mat-primary'] + panelClass: ['mat-toolbar', 'mat-primary', 'simple-snack-bar'] }); } } diff --git a/src/styles.scss b/src/styles.scss index 4396c37..63faf2f 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -20,4 +20,8 @@ h1:before { .mat-list-item-content { width: 100%; -} \ No newline at end of file +} + +.simple-snack-bar .mat-simple-snackbar { + justify-content: center; + } \ No newline at end of file