diff --git a/src/app/notifier.service.ts b/src/app/notifier.service.ts index 83faa42..95c8d9b 100644 --- a/src/app/notifier.service.ts +++ b/src/app/notifier.service.ts @@ -9,7 +9,7 @@ export class NotifierService { constructor(private snackBar:MatSnackBar) { } - showNotification(displayMessage:string, buttonText: string, messageType: 'error' | 'success') { + showNotification(displayMessage:string, buttonText: string, messageType: 'error' | 'success' | 'warning') { this.snackBar.openFromComponent(NotifierComponent, { data: { message: displayMessage, @@ -19,7 +19,16 @@ export class NotifierService { duration: 4000, verticalPosition: 'top', panelClass: [messageType] - }) + }); + this.playSound(); + } + + playSound() { + console.log('Play sound called...'); + let audio = new Audio(); + audio.src = '../assets/notifier.mp3'; + audio.load(); + audio.play(); } } diff --git a/src/app/notifier/notifier..wav b/src/app/notifier/notifier..wav new file mode 100644 index 0000000..4cf0e09 Binary files /dev/null and b/src/app/notifier/notifier..wav differ diff --git a/src/app/notifier/notifier.component.css b/src/app/notifier/notifier.component.css index 072ab95..22d2b82 100644 --- a/src/app/notifier/notifier.component.css +++ b/src/app/notifier/notifier.component.css @@ -29,3 +29,9 @@ background: whitesmoke; color: black; } + +::ng-deep .mat-snack-bar-container.warning { + background: antiquewhite; + color: #fdebd0; + +} diff --git a/src/app/notifier/notifier.component.html b/src/app/notifier/notifier.component.html index 6aaf969..faf7bff 100644 --- a/src/app/notifier/notifier.component.html +++ b/src/app/notifier/notifier.component.html @@ -1,3 +1,4 @@ +