diff --git a/src/app/components/shared/comment-list/comment-list.component.html b/src/app/components/shared/comment-list/comment-list.component.html index abe72767afb09acdb2fbdbc20949d2e929a2dd4f..7c078d5841210f1ee52a763761917d61d4849c4d 100644 --- a/src/app/components/shared/comment-list/comment-list.component.html +++ b/src/app/components/shared/comment-list/comment-list.component.html @@ -3,13 +3,14 @@ <mat-icon>search</mat-icon> </mat-label> <input #searchBox placeholder="{{ 'comment-list-page.search-box-placeholder-text' | translate }}" - (focus)="hideCommentsList=true" (input)="searchComments(searchBox.value)"> - <button mat-flat-button color="accent" *ngIf="hideCommentsList" - (click)="hideCommentsList=false;searchBox.value='';">{{ 'comment-list-page.cancel' | translate }}</button> + (input)="searchComments(searchBox.value)"> + <button mat-button matSuffix *ngIf="searchBox.value" (click)="hideCommentsList=false; searchBox.value=''"> + <mat-icon>close</mat-icon> + </button> </div> -<mat-card class="outer-card" *ngIf="hideCommentsList && searchBox.value!=''"> +<mat-card class="outer-card" *ngIf="hideCommentsList"> <app-comment *ngFor="let current of filteredComments" [comment]="current"> </app-comment> </mat-card> <mat-card class="outer-card" *ngIf="!hideCommentsList"> <app-comment *ngFor="let current of comments" [comment]="current"> </app-comment> -</mat-card> \ No newline at end of file +</mat-card> diff --git a/src/app/components/shared/comment-list/comment-list.component.scss b/src/app/components/shared/comment-list/comment-list.component.scss index 05f9132c8fd215795eda5b6137d6a841a4d526da..bedb367525baef0fa9d0c8a111a0f53cd359fb09 100644 --- a/src/app/components/shared/comment-list/comment-list.component.scss +++ b/src/app/components/shared/comment-list/comment-list.component.scss @@ -1,9 +1,6 @@ mat-card { margin-bottom: 10px; background-color: #4db6ac; - border-radius: 8px; - width: 100%; - max-width: 800px; } app-comment { @@ -13,15 +10,17 @@ app-comment { input { box-sizing: border-box; - padding: 0 10px 0 20px; - width: 100%; - background-color: #4db6ac; + padding: 0 10px 0 5px; + width: 90%; + background-color: #80cbc4; border: none; + outline: none; + max-height: 44px; + font-size: large; + border-radius: 5px; } button{ - border-left: 3px solid #b2dfdb; - border-radius: 0px; min-height: 100% !important; min-width: 100px; } @@ -30,12 +29,8 @@ mat-icon { padding: 10px; } -mat-label { - min-height: 100% !important; - border-radius: 0px; -} - #search-container{ - background-color: #4db6ac; + border-radius: 5px; + background-color: #80cbc4; margin-bottom: 10px; } diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index 801eacc3e5a002ee9a6ff91fca48235f02f66a87..adad9c9015886d5073e2e46419774254f708250f 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -45,7 +45,12 @@ export class CommentListComponent implements OnInit { } searchComments(term: string): void { - this.filteredComments = this.comments.filter(c => c.body.toLowerCase().includes(term)); + if (term) { + this.hideCommentsList = true; + this.filteredComments = this.comments.filter(c => c.body.toLowerCase().includes(term)); + } else { + this.hideCommentsList = false; + } } parseIncomingMessage(message: Message) {