diff --git a/web/sidebar/left-layout-aside.css b/web/sidebar/left-layout-aside.css index 2e0304726..c38a7e82e 100644 --- a/web/sidebar/left-layout-aside.css +++ b/web/sidebar/left-layout-aside.css @@ -1,64 +1,34 @@ .container { grid-area: sBar; background: var(--bg); display: flex; width: 400px; } .navigationPanelContainer { width: 160px; margin-top: 12px; } .navigationPanelTab { display: flex; flex-direction: row; padding: 12px 0 12px 28px; cursor: pointer; } -.navigationPanelTab svg { - padding-right: 12px; - color: var(--color-disabled); - stroke: var(--color-disabled); - fill: var(--color-disabled); -} - .navigationPanelTab p { color: var(--color-disabled); } .navigationPanelTab:hover p, -.navigationPanelTab:hover svg, -div.current_tab p, -div.current_tab svg { +div.current_tab p { color: var(--fg); stroke: var(--fg); fill: var(--fg); } .container p { display: flex; align-content: center; } - -.chatIconWrapper { - position: relative; -} - -span.chatBadge { - position: absolute; - top: -4px; - left: 13px; - 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; -} diff --git a/web/topbar/app-switcher.react.js b/web/topbar/app-switcher.react.js index 3884025dd..6870475bc 100644 --- a/web/topbar/app-switcher.react.js +++ b/web/topbar/app-switcher.react.js @@ -1,134 +1,134 @@ // @flow import * as React from 'react'; import { useDispatch } from 'react-redux'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { mostRecentlyReadThreadSelector, unreadCount, } from 'lib/selectors/thread-selectors.js'; +import css from './topbar.css'; import { updateNavInfoActionType } from '../redux/action-types.js'; import { useSelector } from '../redux/redux-utils.js'; import { navTabSelector } from '../selectors/nav-selectors.js'; -import css from '../sidebar/left-layout-aside.css'; import NavigationPanel from '../sidebar/navigation-panel.react.js'; function AppSwitcher(): React.Node { const activeChatThreadID = useSelector( state => state.navInfo.activeChatThreadID, ); const mostRecentlyReadThread = useSelector(mostRecentlyReadThreadSelector); const isActiveThreadCurrentlyUnread = useSelector( state => !activeChatThreadID || !!state.threadStore.threadInfos[activeChatThreadID]?.currentUser.unread, ); const dispatch = useDispatch(); const onClickChat = React.useCallback( (event: SyntheticEvent) => { event.preventDefault(); dispatch({ type: updateNavInfoActionType, payload: { tab: 'chat', activeChatThreadID: isActiveThreadCurrentlyUnread ? mostRecentlyReadThread : activeChatThreadID, }, }); }, [ dispatch, isActiveThreadCurrentlyUnread, mostRecentlyReadThread, activeChatThreadID, ], ); const boundUnreadCount = useSelector(unreadCount); let chatBadge = null; if (boundUnreadCount > 0) { chatBadge = {boundUnreadCount}; } const chatNavigationItem = React.useMemo( () => ( {chatBadge}

Chat

), [chatBadge, onClickChat], ); const onClickCalendar = React.useCallback( (event: SyntheticEvent) => { event.preventDefault(); dispatch({ type: updateNavInfoActionType, payload: { tab: 'calendar' }, }); }, [dispatch], ); const isCalendarEnabled = useSelector(state => state.enabledApps.calendar); const calendarNavigationItem = React.useMemo(() => { if (!isCalendarEnabled) { return null; } return (

Calendar

); }, [isCalendarEnabled, onClickCalendar]); const onClickApps = React.useCallback( (event: SyntheticEvent) => { event.preventDefault(); dispatch({ type: updateNavInfoActionType, payload: { tab: 'apps', }, }); }, [dispatch], ); const appNavigationItem = React.useMemo( () => (

Apps

), [onClickApps], ); return ( - + {chatNavigationItem} {calendarNavigationItem} {appNavigationItem} ); } export default AppSwitcher; diff --git a/web/topbar/topbar.react.js b/web/topbar/topbar.react.js index 5a7771396..c03099e25 100644 --- a/web/topbar/topbar.react.js +++ b/web/topbar/topbar.react.js @@ -1,13 +1,18 @@ // @flow import * as React from 'react'; +import AppSwitcher from './app-switcher.react.js'; import css from './topbar.css'; function Topbar(): React.Node { - return
dummy
; + return ( +
+ +
+ ); } const MemoizedTopbar: React.ComponentType<{}> = React.memo<{}>(Topbar); export default MemoizedTopbar;