Show "99+" in left pane unread count, instead of high values
This commit is contained in:
parent
bd380086a4
commit
994f9644c4
1 changed files with 11 additions and 1 deletions
|
@ -138,7 +138,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> = React.memo
|
||||||
/>
|
/>
|
||||||
{isUnread && (
|
{isUnread && (
|
||||||
<div className={`${BASE_CLASS_NAME}__unread-count`}>
|
<div className={`${BASE_CLASS_NAME}__unread-count`}>
|
||||||
{unreadCount || ''}
|
{formatUnreadCount(unreadCount)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -233,3 +233,13 @@ export const BaseConversationListItem: FunctionComponent<PropsType> = React.memo
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function formatUnreadCount(count: undefined | number): string {
|
||||||
|
if (!count) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if (count >= 99) {
|
||||||
|
return '99+';
|
||||||
|
}
|
||||||
|
return String(count);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue