diff options
author | Eric Bailey <git@esb.lol> | 2023-11-16 12:54:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 10:54:03 -0800 |
commit | 310a7eaca747e53fb24692998ffe9343762d681f (patch) | |
tree | a0608cfff4ce169e00d0e0010e5d4b799ad35209 /src/view/shell/bottom-bar/BottomBarWeb.tsx | |
parent | a652b52b880c2967e5b70f6f7661891253e20150 (diff) | |
download | voidsky-310a7eaca747e53fb24692998ffe9343762d681f.tar.zst |
Some me model cleanup (#1928)
* Replace me model in post dropdown btn * Replace delete account logic * Replace me model in bottom bar web * Replace me model in bottom bar * Replace me model in reply prompt * Better fallback * Fix reference * Fix bad ref in bottom bar
Diffstat (limited to 'src/view/shell/bottom-bar/BottomBarWeb.tsx')
-rw-r--r-- | src/view/shell/bottom-bar/BottomBarWeb.tsx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/view/shell/bottom-bar/BottomBarWeb.tsx b/src/view/shell/bottom-bar/BottomBarWeb.tsx index ebcc527a1..d58580502 100644 --- a/src/view/shell/bottom-bar/BottomBarWeb.tsx +++ b/src/view/shell/bottom-bar/BottomBarWeb.tsx @@ -1,6 +1,5 @@ import React from 'react' import {observer} from 'mobx-react-lite' -import {useStores} from 'state/index' import {usePalette} from 'lib/hooks/usePalette' import {useNavigationState} from '@react-navigation/native' import Animated from 'react-native-reanimated' @@ -23,9 +22,10 @@ import {Link} from 'view/com/util/Link' import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode' import {makeProfileLink} from 'lib/routes/links' import {CommonNavigatorParams} from 'lib/routes/types' +import {useSession} from '#/state/session' export const BottomBarWeb = observer(function BottomBarWebImpl() { - const store = useStores() + const {currentAccount} = useSession() const pal = usePalette('default') const safeAreaInsets = useSafeAreaInsets() const {footerMinimalShellTransform} = useMinimalShellMode() @@ -88,7 +88,16 @@ export const BottomBarWeb = observer(function BottomBarWebImpl() { ) }} </NavItem> - <NavItem routeName="Profile" href={makeProfileLink(store.me)}> + <NavItem + routeName="Profile" + href={ + currentAccount + ? makeProfileLink({ + did: currentAccount.did, + handle: currentAccount.handle, + }) + : '/' + }> {({isActive}) => { const Icon = isActive ? UserIconSolid : UserIcon return ( @@ -109,18 +118,18 @@ const NavItem: React.FC<{ href: string routeName: string }> = ({children, href, routeName}) => { + const {currentAccount} = useSession() const currentRoute = useNavigationState(state => { if (!state) { return {name: 'Home'} } return getCurrentRoute(state) }) - const store = useStores() const isActive = currentRoute.name === 'Profile' ? isTab(currentRoute.name, routeName) && (currentRoute.params as CommonNavigatorParams['Profile']).name === - store.me.handle + currentAccount?.handle : isTab(currentRoute.name, routeName) return ( |