|
1 | 1 | <div class="chat-container"> |
2 | 2 | @if (showHeader) { |
3 | | - <mat-toolbar color="primary" class="chat-toolbar"> |
4 | | - <span>{{ title }}</span> |
5 | | - <span class="spacer"></span> |
| 3 | + <mat-toolbar color="primary" class="chat-toolbar"> |
| 4 | + <span>{{ title }}</span> |
| 5 | + <span class="spacer"></span> |
6 | 6 |
|
7 | | - <button mat-icon-button |
8 | | - matTooltip="Take me to the assignment" |
9 | | - (click)="navigateToAssignment()"> |
10 | | - <mat-icon class="black-icon">assignment</mat-icon> |
11 | | - </button> |
| 7 | + <button mat-icon-button matTooltip="Take me to the assignment" (click)="navigateToAssignment()"> |
| 8 | + <mat-icon class="black-icon">assignment</mat-icon> |
| 9 | + </button> |
12 | 10 |
|
13 | | - <button mat-icon-button [matMenuTriggerFor]="visibilityMenu" aria-label="Change visibility"> |
14 | | - <mat-icon class="black-icon">more_vert</mat-icon> |
15 | | - </button> |
| 11 | + <button mat-icon-button [matMenuTriggerFor]="visibilityMenu" aria-label="Change visibility"> |
| 12 | + <mat-icon class="black-icon">more_vert</mat-icon> |
| 13 | + </button> |
16 | 14 |
|
17 | | - <mat-menu #visibilityMenu="matMenu"> |
18 | | - <button mat-menu-item |
19 | | - (click)="updateVisibility(VisibilityType.PRIVATE)" |
20 | | - [class.selected]="currentThread.visibility === VisibilityType.PRIVATE"> |
21 | | - <mat-icon>{{ currentThread.visibility === VisibilityType.PRIVATE ? 'radio_button_checked' : 'radio_button_unchecked' }}</mat-icon> |
22 | | - <span>Private</span> |
23 | | - </button> |
24 | | - <button mat-menu-item |
25 | | - (click)="updateVisibility(VisibilityType.GROUP)" |
26 | | - [class.selected]="currentThread.visibility === VisibilityType.GROUP"> |
27 | | - <mat-icon>{{ currentThread.visibility === VisibilityType.GROUP ? 'radio_button_checked' : 'radio_button_unchecked' }}</mat-icon> |
28 | | - <span>Group</span> |
29 | | - </button> |
30 | | - </mat-menu> |
31 | | - </mat-toolbar> |
| 15 | + <mat-menu #visibilityMenu="matMenu"> |
| 16 | + <button mat-menu-item (click)="updateVisibility(VisibilityType.PRIVATE)" |
| 17 | + [class.selected]="currentThread.visibility === VisibilityType.PRIVATE"> |
| 18 | + <mat-icon>{{ currentThread.visibility === VisibilityType.PRIVATE ? 'radio_button_checked' : |
| 19 | + 'radio_button_unchecked' }}</mat-icon> |
| 20 | + <span>Private</span> |
| 21 | + </button> |
| 22 | + <button mat-menu-item (click)="updateVisibility(VisibilityType.GROUP)" |
| 23 | + [class.selected]="currentThread.visibility === VisibilityType.GROUP"> |
| 24 | + <mat-icon>{{ currentThread.visibility === VisibilityType.GROUP ? 'radio_button_checked' : |
| 25 | + 'radio_button_unchecked' }}</mat-icon> |
| 26 | + <span>Group</span> |
| 27 | + </button> |
| 28 | + </mat-menu> |
| 29 | + </mat-toolbar> |
32 | 30 | } |
33 | | - |
| 31 | + |
34 | 32 | <div class="messages-container" #messagesContainer> |
35 | 33 | @for (msg of messages; track msg.id) { |
36 | | - <mat-card class="message-card" [class.user-message]="isUserMessage(msg)"> |
37 | | - <mat-card-title> |
38 | | - {{ usernamesMap[msg.senderId] || 'User' }} |
39 | | - <span class="timestamp">{{ msg.createdAt | date: 'short' }}</span> |
40 | | - </mat-card-title> |
41 | | - <mat-card-content>{{ msg.content }}</mat-card-content> |
42 | | - </mat-card> |
| 34 | + <mat-card class="message-card" [class.user-message]="isUserMessage(msg)"> |
| 35 | + <mat-card-title> |
| 36 | + {{ usernamesMap[msg.senderId] || 'User' }} |
| 37 | + <span class="timestamp">{{ msg.createdAt | date: 'short' }}</span> |
| 38 | + </mat-card-title> |
| 39 | + <mat-card-content>{{ msg.content }}</mat-card-content> |
| 40 | + </mat-card> |
43 | 41 | } |
44 | 42 | </div> |
45 | 43 |
|
46 | 44 | <form (ngSubmit)="sendMessage()" class="message-input"> |
47 | 45 | <mat-form-field appearance="outline" class="input-field"> |
48 | | - <textarea matInput [(ngModel)]="newMessageContent" name="message" |
49 | | - placeholder="Type your message..." autocomplete="off" |
50 | | - cdkTextareaAutosize |
51 | | - cdkAutosizeMinRows="1" |
52 | | - cdkAutosizeMaxRows="10" |
53 | | - #textArea> |
| 46 | + <textarea matInput [(ngModel)]="newMessageContent" name="message" placeholder="Type your message..." |
| 47 | + autocomplete="off" cdkTextareaAutosize cdkAutosizeMinRows="1" cdkAutosizeMaxRows="10" |
| 48 | + (keydown.enter)="sendMessage()" #textArea> |
54 | 49 | </textarea> |
| 50 | + |
55 | 51 | </mat-form-field> |
56 | 52 | <button mat-icon-button color="primary" type="submit"> |
57 | 53 | <mat-icon>send</mat-icon> |
|
0 commit comments