Skip to content
Snippets Groups Projects
Commit 6c4d2939 authored by Ruben Bimberg's avatar Ruben Bimberg :computer:
Browse files

Merge branch 'staging' into 704-address-the-bonus-mail-to-the-creator-with-cc-to-all-moderators

parents af8d35b7 87023af7
No related merge requests found
......@@ -10,6 +10,7 @@ import { CommentService } from '../services/http/comment.service';
import { observable, Observable, of } from 'rxjs';
import { flatMap } from 'rxjs/internal/operators';
import { tap } from 'rxjs/operators';
import { MatSnackBarConfig } from '@angular/material/snack-bar';
export class CreateCommentWrapper {
constructor(private translateService: TranslateService,
......@@ -36,6 +37,9 @@ export class CreateCommentWrapper {
send(comment: Comment): Observable<Comment> {
let message;
const config: MatSnackBarConfig = {
panelClass: ['snackbar']
};
if (this.room.directSend) {
this.translateService.get('comment-list.comment-sent').subscribe(msg => {
message = msg;
......@@ -44,10 +48,11 @@ export class CreateCommentWrapper {
} else {
this.translateService.get('comment-list.comment-sent-to-moderator').subscribe(msg => {
message = msg;
(config.panelClass as string[]).push('important');
});
}
return this.commentService.addComment(comment).pipe(
tap(() => this.notificationService.show(message))
tap(() => this.notificationService.show(message, null, config))
);
}
}
......@@ -19,6 +19,12 @@ mat-form-field.input-block {
color: var(--on-secondary);
}
.snackbar.important {
background-color: var(--red);
color: var(--white);
font-weight: bolder;
}
.snackbar button {
background-color: var(--primary);
color: var(--on-primary) !important;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment