Left pane spacing tweaks
This commit is contained in:
parent
da9df293c6
commit
29e6ba8f10
3 changed files with 44 additions and 21 deletions
|
@ -51,7 +51,7 @@ import {
|
|||
SaveAvatarToDiskActionType,
|
||||
} from '../types/Avatar';
|
||||
|
||||
const MIN_WIDTH = 119;
|
||||
const MIN_WIDTH = 109;
|
||||
const MIN_SNAP_WIDTH = 280;
|
||||
const MIN_FULL_WIDTH = 320;
|
||||
const MAX_WIDTH = 380;
|
||||
|
|
|
@ -173,11 +173,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> = React.memo
|
|||
</div>
|
||||
)}
|
||||
{messageStatusIcon}
|
||||
{isUnread && (
|
||||
<div className={`${BASE_CLASS_NAME}__unread-count`}>
|
||||
{formatUnreadCount(unreadCount)}
|
||||
</div>
|
||||
)}
|
||||
{isUnread && <UnreadCount count={unreadCount} />}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
@ -235,12 +231,15 @@ export const BaseConversationListItem: FunctionComponent<PropsType> = React.memo
|
|||
}
|
||||
);
|
||||
|
||||
function formatUnreadCount(count: undefined | number): string {
|
||||
if (!count) {
|
||||
return '';
|
||||
}
|
||||
if (count >= 99) {
|
||||
return '99+';
|
||||
}
|
||||
return String(count);
|
||||
function UnreadCount({ count = 0 }: Readonly<{ count?: number }>) {
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
`${BASE_CLASS_NAME}__unread-count`,
|
||||
count > 99 && `${BASE_CLASS_NAME}__unread-count--big`
|
||||
)}
|
||||
>
|
||||
{Boolean(count) && Math.min(count, 99)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue