Chats: fix unread counter

ci-review-rules
Alex Gleason 2022-05-27 20:14:41 -04:00
rodzic 79a7b7998a
commit c1227079ac
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -12,8 +12,8 @@ import { createSelector } from 'reselect';
import { openChat, launchChat, toggleMainWindow } from 'soapbox/actions/chats'; import { openChat, launchChat, toggleMainWindow } from 'soapbox/actions/chats';
import { getSettings } from 'soapbox/actions/settings'; import { getSettings } from 'soapbox/actions/settings';
import AccountSearch from 'soapbox/components/account_search'; import AccountSearch from 'soapbox/components/account_search';
import { Counter } from 'soapbox/components/ui';
import AudioToggle from 'soapbox/features/chats/components/audio_toggle'; import AudioToggle from 'soapbox/features/chats/components/audio_toggle';
import { shortNumberFormat } from 'soapbox/utils/numbers';
import ChatList from './chat_list'; import ChatList from './chat_list';
import ChatWindow from './chat_window'; import ChatWindow from './chat_window';
@ -83,7 +83,11 @@ class ChatPanes extends ImmutablePureComponent {
const mainWindowPane = ( const mainWindowPane = (
<div className={`pane pane--main pane--${mainWindowState}`}> <div className={`pane pane--main pane--${mainWindowState}`}>
<div className='pane__header'> <div className='pane__header'>
{unreadCount > 0 && <i className='icon-with-badge__badge'>{shortNumberFormat(unreadCount)}</i>} {unreadCount > 0 && (
<div className='mr-2 flex-none'>
<Counter count={unreadCount} />
</div>
)}
<button className='pane__title' onClick={this.handleMainWindowToggle}> <button className='pane__title' onClick={this.handleMainWindowToggle}>
<FormattedMessage id='chat_panels.main_window.title' defaultMessage='Chats' /> <FormattedMessage id='chat_panels.main_window.title' defaultMessage='Chats' />
</button> </button>

Wyświetl plik

@ -13,9 +13,9 @@ import {
import Avatar from 'soapbox/components/avatar'; import Avatar from 'soapbox/components/avatar';
import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper'; import HoverRefWrapper from 'soapbox/components/hover_ref_wrapper';
import IconButton from 'soapbox/components/icon_button'; import IconButton from 'soapbox/components/icon_button';
import { Counter } from 'soapbox/components/ui';
import { makeGetChat } from 'soapbox/selectors'; import { makeGetChat } from 'soapbox/selectors';
import { getAcct } from 'soapbox/utils/accounts'; import { getAcct } from 'soapbox/utils/accounts';
import { shortNumberFormat } from 'soapbox/utils/numbers';
import { displayFqn } from 'soapbox/utils/state'; import { displayFqn } from 'soapbox/utils/state';
import ChatBox from './chat_box'; import ChatBox from './chat_box';
@ -98,9 +98,9 @@ class ChatWindow extends ImmutablePureComponent {
const unreadCount = chat.get('unread'); const unreadCount = chat.get('unread');
const unreadIcon = ( const unreadIcon = (
<i className='icon-with-badge__badge'> <div className='mr-2 flex-none'>
{shortNumberFormat(unreadCount)} <Counter count={unreadCount} />
</i> </div>
); );
const avatar = ( const avatar = (