import { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu'; import { useSnapshot } from 'valtio'; import { api } from '../utils/api'; import states from '../utils/states'; import Icon from './icon'; import MenuLink from './MenuLink'; function NavMenu(props) { const snapStates = useSnapshot(states); const { instance, authenticated } = api(); // Home = Following // But when in multi-column mode, Home becomes columns of anything // User may choose pin or not to pin Following // If user doesn't pin Following, we show it in the menu const showFollowing = snapStates.settings.shortcutsColumnsMode && !snapStates.shortcuts.find((pin) => pin.type === 'following'); return ( } > {!!snapStates.appVersion?.commitHash && __COMMIT_HASH__ !== snapStates.appVersion.commitHash && ( <> { const yes = confirm('Reload page now to update?'); if (yes) { (async () => { try { location.reload(); } catch (e) {} })(); } }} > {' '} New update available… )} Home {authenticated && ( <> {showFollowing && ( Following )} Notifications {snapStates.notificationsShowNew && ( {' '} • )} Lists Followed Hashtags Bookmarks Favourites )} Search Local Federated {authenticated && ( <> { states.showShortcutsSettings = true; }} > {' '} Shortcuts Settings… { states.showSettings = true; }} > Settings… )} ); } export default NavMenu;