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); @@ -100,6 +101,20 @@ [css['current-tab']]: navInfo.tab === 'apps', }); + const calendarLink = React.useMemo(() => { + if (!isCalendarEnabled) { + return null; + } + return ( + <li> + <p className={calendarNavClasses}> + <SWMansionIcon icon="calendar" size={24} /> + <a onClick={onClickCalendar}>Calendar</a> + </p> + </li> + ); + }, [calendarNavClasses, isCalendarEnabled, onClickCalendar]); + return ( <div className={css.container}> <ul> @@ -112,12 +127,7 @@ <a onClick={onClickChat}>Chat</a> </p> </li> - <li> - <p className={calendarNavClasses}> - <SWMansionIcon icon="calendar" size={24} /> - <a onClick={onClickCalendar}>Calendar</a> - </p> - </li> + {calendarLink} <li> <p className={appsNavClasses}> <SWMansionIcon icon="wrench" size={24} />