diff options
author | Jaz <ericvolp12@gmail.com> | 2023-05-30 18:25:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 18:25:29 -0700 |
commit | 09ade363fdcfadb03433385e0c5510bc58438a65 (patch) | |
tree | 710af28d1eb7f70acf81f86acb44759439e164fc /src/view/shell/desktop/LeftNav.tsx | |
parent | 7f76c2d67e62ba2d10e8b17673a7bbcf7248564f (diff) | |
parent | e224569a11b82361d782324a63bdfc19d44a3201 (diff) | |
download | voidsky-09ade363fdcfadb03433385e0c5510bc58438a65.tar.zst |
Merge branch 'main' into inherit_system_theme
Diffstat (limited to 'src/view/shell/desktop/LeftNav.tsx')
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index ba48dd2ae..914dfb53a 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -30,6 +30,8 @@ import { CogIconSolid, ComposeIcon2, HandIcon, + SatelliteDishIcon, + SatelliteDishIconSolid, } from 'lib/icons' import {getCurrentRoute, isTab, isStateAtTabRoot} from 'lib/routes/helpers' import {NavigationProp} from 'lib/routes/types' @@ -89,14 +91,17 @@ const NavItem = observer( const pal = usePalette('default') const store = useStores() const [pathName] = React.useMemo(() => router.matchPath(href), [href]) - const currentRouteName = useNavigationState(state => { + const currentRouteInfo = useNavigationState(state => { if (!state) { - return 'Home' + return {name: 'Home'} } - return getCurrentRoute(state).name + return getCurrentRoute(state) }) - - const isCurrent = isTab(currentRouteName, pathName) + let isCurrent = + currentRouteInfo.name === 'Profile' + ? isTab(currentRouteInfo.name, pathName) && + currentRouteInfo.params.name === store.me.handle + : isTab(currentRouteInfo.name, pathName) const {onPress} = useLinkProps({to: href}) const onPressWrapped = React.useCallback( (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => { @@ -196,6 +201,24 @@ export const DesktopLeftNav = observer(function DesktopLeftNav() { label="Search" /> <NavItem + href="/feeds" + icon={ + <SatelliteDishIcon + strokeWidth={1.75} + style={pal.text as FontAwesomeIconStyle} + size={24} + /> + } + iconFilled={ + <SatelliteDishIconSolid + strokeWidth={1.75} + style={pal.text as FontAwesomeIconStyle} + size={24} + /> + } + label="My Feeds" + /> + <NavItem href="/notifications" count={store.me.notifications.unreadCountLabel} icon={<BellIcon strokeWidth={2} size={24} style={pal.text} />} |