Changeset View
Changeset View
Standalone View
Standalone View
web/topbar/app-switcher.react.js
// @flow | // @flow | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { useDispatch } from 'react-redux'; | import { useDispatch } from 'react-redux'; | ||||
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; | import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; | ||||
import { | import { | ||||
mostRecentlyReadThreadSelector, | mostRecentlyReadThreadSelector, | ||||
unreadCount, | unreadCount, | ||||
} from 'lib/selectors/thread-selectors.js'; | } from 'lib/selectors/thread-selectors.js'; | ||||
import css from './topbar.css'; | |||||
import { updateNavInfoActionType } from '../redux/action-types.js'; | import { updateNavInfoActionType } from '../redux/action-types.js'; | ||||
import { useSelector } from '../redux/redux-utils.js'; | import { useSelector } from '../redux/redux-utils.js'; | ||||
import { navTabSelector } from '../selectors/nav-selectors.js'; | import { navTabSelector } from '../selectors/nav-selectors.js'; | ||||
import css from '../sidebar/left-layout-aside.css'; | |||||
import NavigationPanel from '../sidebar/navigation-panel.react.js'; | import NavigationPanel from '../sidebar/navigation-panel.react.js'; | ||||
function AppSwitcher(): React.Node { | function AppSwitcher(): React.Node { | ||||
const activeChatThreadID = useSelector( | const activeChatThreadID = useSelector( | ||||
state => state.navInfo.activeChatThreadID, | state => state.navInfo.activeChatThreadID, | ||||
); | ); | ||||
const mostRecentlyReadThread = useSelector(mostRecentlyReadThreadSelector); | const mostRecentlyReadThread = useSelector(mostRecentlyReadThreadSelector); | ||||
const isActiveThreadCurrentlyUnread = useSelector( | const isActiveThreadCurrentlyUnread = useSelector( | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | () => ( | ||||
<p>Apps</p> | <p>Apps</p> | ||||
</a> | </a> | ||||
</NavigationPanel.Item> | </NavigationPanel.Item> | ||||
), | ), | ||||
[onClickApps], | [onClickApps], | ||||
); | ); | ||||
return ( | return ( | ||||
<NavigationPanel.Container tabSelector={navTabSelector}> | <NavigationPanel.Container tabSelector={navTabSelector} horizontal={true}> | ||||
{chatNavigationItem} | {chatNavigationItem} | ||||
{calendarNavigationItem} | {calendarNavigationItem} | ||||
{appNavigationItem} | {appNavigationItem} | ||||
</NavigationPanel.Container> | </NavigationPanel.Container> | ||||
); | ); | ||||
} | } | ||||
export default AppSwitcher; | export default AppSwitcher; |