Drop unread indicator limit and fix overflow issue

This commit is contained in:
Alvaro 2023-01-25 10:27:59 -07:00 committed by GitHub
parent 2d9cbf4795
commit f751687af3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 39 deletions

View file

@ -4607,17 +4607,13 @@ button.module-image__border-overlay:focus {
@include dark-theme { @include dark-theme {
border-color: $color-gray-80; border-color: $color-gray-80;
} }
&--two-digits,
&--many {
right: -(7px + $border-width);
}
} }
} }
// We want this to just be the unread indicator selector, not a child of the parent. // We want this to just be the unread indicator selector, not a child of the parent.
@at-root #{$unread-indicator-selector} { @at-root #{$unread-indicator-selector} {
$size: 18px; $size: 18px;
flex-shrink: 0;
@include font-caption-bold; @include font-caption-bold;
border-radius: 10px; border-radius: 10px;
@ -4628,8 +4624,8 @@ button.module-image__border-overlay:focus {
margin-left: 10px; margin-left: 10px;
margin-top: 1px; margin-top: 1px;
min-width: $size; min-width: $size;
padding-left: 3px; padding-left: 4px;
padding-right: 3px; padding-right: 4px;
text-align: center; text-align: center;
word-break: normal; word-break: normal;
display: flex; display: flex;
@ -4646,22 +4642,6 @@ button.module-image__border-overlay:focus {
@include dark-theme { @include dark-theme {
background-color: $color-ultramarine-dawn; background-color: $color-ultramarine-dawn;
} }
&--two-digits,
&--many {
padding-left: 4px;
padding-right: 4px;
}
&--many {
font-size: 10px;
&::after {
content: '+';
display: inline-block;
font-size: 9px;
}
}
} }
&__content { &__content {

View file

@ -398,7 +398,7 @@ ConversationMessageRequest.story = {
export function ConversationsUnreadCount(): JSX.Element { export function ConversationsUnreadCount(): JSX.Element {
return ( return (
<Wrapper <Wrapper
rows={[4, 10, 34, 250].map(unreadCount => ({ rows={[4, 10, 34, 250, 2048].map(unreadCount => ({
type: RowType.Conversation, type: RowType.Conversation,
conversation: createConversation({ conversation: createConversation({
lastMessage: { lastMessage: {

View file

@ -310,22 +310,9 @@ function UnreadIndicator({
return null; return null;
} }
let classModifier: undefined | string;
if (count > 99) {
classModifier = 'many';
} else if (count > 9) {
classModifier = 'two-digits';
}
return ( return (
<div <div className={classNames(`${BASE_CLASS_NAME}__unread-indicator`)}>
className={classNames( {Boolean(count) && count}
`${BASE_CLASS_NAME}__unread-indicator`,
classModifier &&
`${BASE_CLASS_NAME}__unread-indicator--${classModifier}`
)}
>
{Boolean(count) && Math.min(count, 99)}
</div> </div>
); );
} }