Add unread count to the stories badge

This commit is contained in:
Josh Perez 2022-07-20 19:06:15 -04:00 committed by GitHub
parent ea058371ed
commit 581b841098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 116 additions and 63 deletions

View file

@ -26,6 +26,7 @@ export type PropsType = {
profileName?: string;
theme: ThemeType;
title: string;
unreadStoriesCount: number;
showArchivedConversations: () => void;
startComposing: () => void;
@ -132,6 +133,7 @@ export class MainHeader extends React.Component<PropsType, StateType> {
title,
toggleProfileEditor,
toggleStoriesView,
unreadStoriesCount,
} = this.props;
const { showingAvatarPopup, popperRoot } = this.state;
@ -222,7 +224,13 @@ export class MainHeader extends React.Component<PropsType, StateType> {
onClick={toggleStoriesView}
title={i18n('stories')}
type="button"
/>
>
{unreadStoriesCount ? (
<span className="module-main-header__stories-badge">
{unreadStoriesCount}
</span>
) : undefined}
</button>
)}
<button
aria-label={i18n('newConversation')}