Changeset View
Changeset View
Standalone View
Standalone View
web/navigation-panels/app-switcher.react.js
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | return ( | ||||
<a className={css.navigationPanelTab} onClick={onClickCalendar}> | <a className={css.navigationPanelTab} onClick={onClickCalendar}> | ||||
<SWMansionIcon icon="calendar" size={24} /> | <SWMansionIcon icon="calendar" size={24} /> | ||||
<p>Calendar</p> | <p>Calendar</p> | ||||
</a> | </a> | ||||
</NavigationPanel.Item> | </NavigationPanel.Item> | ||||
); | ); | ||||
}, [isCalendarEnabled, onClickCalendar]); | }, [isCalendarEnabled, onClickCalendar]); | ||||
const onClickApps = React.useCallback( | |||||
(event: SyntheticEvent<HTMLAnchorElement>) => { | |||||
event.preventDefault(); | |||||
dispatch({ | |||||
type: updateNavInfoActionType, | |||||
payload: { | |||||
tab: 'apps', | |||||
}, | |||||
}); | |||||
}, | |||||
[dispatch], | |||||
); | |||||
const appNavigationItem = React.useMemo( | |||||
() => ( | |||||
<NavigationPanel.Item tab="apps"> | |||||
<a className={css.navigationPanelTab} onClick={onClickApps}> | |||||
<SWMansionIcon icon="globe-1" size={24} /> | |||||
<p>Apps</p> | |||||
</a> | |||||
</NavigationPanel.Item> | |||||
), | |||||
[onClickApps], | |||||
); | |||||
return ( | return ( | ||||
<NavigationPanel.Container tabSelector={navTabSelector} horizontal={true}> | <NavigationPanel.Container tabSelector={navTabSelector} horizontal={true}> | ||||
{chatNavigationItem} | {chatNavigationItem} | ||||
{calendarNavigationItem} | {calendarNavigationItem} | ||||
{appNavigationItem} | |||||
</NavigationPanel.Container> | </NavigationPanel.Container> | ||||
); | ); | ||||
} | } | ||||
export default AppSwitcher; | export default AppSwitcher; |