Skip to content

Commit

Permalink
Restore indicator when conversation is manually marked unread
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed May 24, 2023
1 parent c0663ed commit 2dc2454
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion stylesheets/_modules.scss
Expand Up @@ -4501,7 +4501,8 @@ button.module-image__border-overlay:focus {
@include dark-theme {
background-color: $color-ultramarine-dawn;
}
&--unread-messages {
&--unread-messages,
&--marked-unread {
@include font-caption-bold;
text-align: center;
word-break: normal;
Expand Down
11 changes: 10 additions & 1 deletion ts/components/conversationList/BaseConversationListItem.tsx
Expand Up @@ -182,7 +182,9 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
variant={UnreadIndicatorVariant.UNREAD_MESSAGES}
count={unreadCount}
/>
) : null}
) : (
<UnreadIndicator variant={UnreadIndicatorVariant.MARKED_UNREAD} />
)}
</div>
);
})();
Expand Down Expand Up @@ -337,11 +339,15 @@ function Timestamp({
}

enum UnreadIndicatorVariant {
MARKED_UNREAD = 'marked-unread',
UNREAD_MESSAGES = 'unread-messages',
UNREAD_MENTIONS = 'unread-mentions',
}

type UnreadIndicatorPropsType =
| {
variant: UnreadIndicatorVariant.MARKED_UNREAD;
}
| {
variant: UnreadIndicatorVariant.UNREAD_MESSAGES;
count: number;
Expand All @@ -352,6 +358,9 @@ function UnreadIndicator(props: UnreadIndicatorPropsType) {
let content: React.ReactNode;

switch (props.variant) {
case UnreadIndicatorVariant.MARKED_UNREAD:
content = null;
break;
case UnreadIndicatorVariant.UNREAD_MESSAGES:
content = props.count > 0 && props.count;
break;
Expand Down

0 comments on commit 2dc2454

Please sign in to comment.