diff --git a/web/sidebar/app-switcher.react.js b/web/sidebar/app-switcher.react.js --- a/web/sidebar/app-switcher.react.js +++ b/web/sidebar/app-switcher.react.js @@ -32,6 +32,7 @@ ); const boundUnreadCount = useSelector(unreadCount); + const isCalendarEnabled = useSelector(state => state.enabledApps.calendar); React.useEffect(() => { document.title = getTitle(boundUnreadCount); @@ -90,9 +91,6 @@ chatBadge =
{boundUnreadCount}
; } - const calendarNavClasses = classNames({ - [css['current-tab']]: navInfo.tab === 'calendar', - }); const chatNavClasses = classNames({ [css['current-tab']]: navInfo.tab === 'chat', }); @@ -100,6 +98,23 @@ [css['current-tab']]: navInfo.tab === 'apps', }); + const calendarLink = React.useMemo(() => { + if (!isCalendarEnabled) { + return null; + } + const calendarNavClasses = classNames({ + [css['current-tab']]: navInfo.tab === 'calendar', + }); + return ( +
  • +

    + + Calendar +

    +
  • + ); + }, [isCalendarEnabled, navInfo.tab, onClickCalendar]); + return (