From 0b61f1dfca941d6dd0f2fa174e3a46bcfd9975aa Mon Sep 17 00:00:00 2001 From: "khaled.njim" Date: Tue, 10 Sep 2024 11:44:35 +0100 Subject: [PATCH] fixup! fixup! TW-1902 update icons, text style --- lib/pages/chat_list/chat_list_item_subtitle.dart | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/pages/chat_list/chat_list_item_subtitle.dart b/lib/pages/chat_list/chat_list_item_subtitle.dart index 45860fd752..4d4205e408 100644 --- a/lib/pages/chat_list/chat_list_item_subtitle.dart +++ b/lib/pages/chat_list/chat_list_item_subtitle.dart @@ -27,6 +27,15 @@ class ChatListItemSubtitle extends StatelessWidget with ChatListItemMixin { room.hasNewMessages, room.notificationCount > 0, ); + final isMediaEvent = room.lastEvent?.messageType == MessageTypes.Image || + room.lastEvent?.messageType == MessageTypes.Video; + + final haveNotificationsAndMuted = + room.notificationCount > 0 && room.isMuted; + + final haveNotificationsOrUnread = + room.notificationCount > 0 || room.markedUnread; + return Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -39,8 +48,7 @@ class ChatListItemSubtitle extends StatelessWidget with ChatListItemMixin { context: context, room: room, ) - : room.lastEvent?.messageType == MessageTypes.Image || - room.lastEvent?.messageType == MessageTypes.Video + : isMediaEvent ? chatlistItemMediaPreviewSubTitle( context, room, @@ -128,9 +136,9 @@ class ChatListItemSubtitle extends StatelessWidget with ChatListItemMixin { color: room.highlightCount > 0 || room.membership == Membership.invite ? Theme.of(context).colorScheme.primary - : room.notificationCount > 0 && room.isMuted + : haveNotificationsAndMuted ? LinagoraRefColors.material().tertiary[30] - : room.notificationCount > 0 || room.markedUnread + : haveNotificationsOrUnread ? Theme.of(context).colorScheme.primary : LinagoraRefColors.material().tertiary[30], borderRadius: BorderRadius.circular(AppConfig.borderRadius),