diff --git a/web/sidebar/community-picker.css b/web/sidebar/community-picker.css --- a/web/sidebar/community-picker.css +++ b/web/sidebar/community-picker.css @@ -72,3 +72,18 @@ padding-left: 12px; color: var(--fg); } + +span.chatBadge { + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + color: var(--fg); + background: var(--unread-bg); + border-radius: 13px; + font-size: 8px; + line-height: 1.25; + margin-right: 4px; +} diff --git a/web/sidebar/community-picker.react.js b/web/sidebar/community-picker.react.js --- a/web/sidebar/community-picker.react.js +++ b/web/sidebar/community-picker.react.js @@ -5,6 +5,7 @@ import { useDispatch } from 'react-redux'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; +import { unreadCount } from 'lib/selectors/thread-selectors.js'; import CommunityDrawer from './community-drawer.react.js'; import css from './community-picker.css'; @@ -66,6 +67,12 @@ [css.sideLineActive]: isSettingsOpen, }); + const boundUnreadCount = useSelector(unreadCount); + let chatBadge = null; + if (boundUnreadCount > 0 && !isCalendarOpen) { + chatBadge = {boundUnreadCount}; + } + return (
@@ -73,6 +80,8 @@
{inboxButtonTitle}
+
+ {chatBadge}