Chat: fix unread counter
This commit is contained in:
parent
04a56c2ad5
commit
d371ec506d
1 changed files with 6 additions and 2 deletions
|
@ -4,10 +4,10 @@ import { FormattedMessage } from 'react-intl';
|
||||||
import Avatar from 'soapbox/components/avatar';
|
import Avatar from 'soapbox/components/avatar';
|
||||||
import DisplayName from 'soapbox/components/display-name';
|
import DisplayName from 'soapbox/components/display-name';
|
||||||
import Icon from 'soapbox/components/icon';
|
import Icon from 'soapbox/components/icon';
|
||||||
|
import { Counter } from 'soapbox/components/ui';
|
||||||
import emojify from 'soapbox/features/emoji/emoji';
|
import emojify from 'soapbox/features/emoji/emoji';
|
||||||
import { useAppSelector } from 'soapbox/hooks';
|
import { useAppSelector } from 'soapbox/hooks';
|
||||||
import { makeGetChat } from 'soapbox/selectors';
|
import { makeGetChat } from 'soapbox/selectors';
|
||||||
import { shortNumberFormat } from 'soapbox/utils/numbers';
|
|
||||||
|
|
||||||
import type { Account as AccountEntity, Chat as ChatEntity } from 'soapbox/types/entities';
|
import type { Account as AccountEntity, Chat as ChatEntity } from 'soapbox/types/entities';
|
||||||
|
|
||||||
|
@ -59,7 +59,11 @@ const Chat: React.FC<IChat> = ({ chatId, onClick }) => {
|
||||||
{image ? <FormattedMessage id='chats.attachment_image' defaultMessage='Image' /> : <FormattedMessage id='chats.attachment' defaultMessage='Attachment' />}
|
{image ? <FormattedMessage id='chats.attachment_image' defaultMessage='Image' /> : <FormattedMessage id='chats.attachment' defaultMessage='Attachment' />}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{unreadCount > 0 && <i className='icon-with-badge__badge'>{shortNumberFormat(unreadCount)}</i>}
|
{unreadCount > 0 && (
|
||||||
|
<div className='absolute top-1 right-0'>
|
||||||
|
<Counter count={unreadCount} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue