From 7cab76b0f1cceb32ded90871ae0f9eb3ab9988ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Mon, 10 Jun 2019 12:57:45 +0200
Subject: [PATCH] Add color to current sort criteria

---
 .../shared/comment-list/comment-list.component.html       | 6 +++---
 .../shared/comment-list/comment-list.component.scss       | 8 ++++++++
 .../shared/comment-list/comment-list.component.ts         | 4 ++--
 3 files changed, 13 insertions(+), 5 deletions(-)

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 a03d29cdc..65fb047c7 100644
--- a/src/app/components/shared/comment-list/comment-list.component.html
+++ b/src/app/components/shared/comment-list/comment-list.component.html
@@ -35,15 +35,15 @@
 
   <mat-menu #sortMenu="matMenu" xPosition="before">
       <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(votedesc)">
-        <mat-icon>keyboard_arrow_up</mat-icon>
+        <mat-icon [ngClass]="{votedesc: 'up'}[currentSort]">keyboard_arrow_up</mat-icon>
       </button>
 
       <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(voteasc)">
-        <mat-icon>keyboard_arrow_down</mat-icon>
+        <mat-icon [ngClass]="{voteasc: 'down'}[currentSort]">keyboard_arrow_down</mat-icon>
       </button>
 
       <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(time)">
-        <mat-icon>access_time</mat-icon>
+        <mat-icon [ngClass]="{time: 'unread-icon'}[currentSort]">access_time</mat-icon>
       </button>
   </mat-menu>
 
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 76f69bd73..1c6e49a66 100644
--- a/src/app/components/shared/comment-list/comment-list.component.scss
+++ b/src/app/components/shared/comment-list/comment-list.component.scss
@@ -83,3 +83,11 @@ h4  {
 .comment-counter {
   font-size: 18pt;
 }
+
+.up {
+  color: var(--green);
+}
+
+.down {
+  color: var(--red);
+}
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 8e313d94a..4ff0c4579 100644
--- a/src/app/components/shared/comment-list/comment-list.component.ts
+++ b/src/app/components/shared/comment-list/comment-list.component.ts
@@ -29,8 +29,8 @@ export class CommentListComponent implements OnInit {
   userRole: UserRole;
   deviceType: string;
   isLoading = true;
-  voteasc = 'vote_asc';
-  votedesc = 'vote_desc';
+  voteasc = 'voteasc';
+  votedesc = 'votedesc';
   time = 'time';
   currentSort = this.votedesc;
   read = 'read';
-- 
GitLab