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/BottomBar.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/BottomBar.tsx')
-rw-r--r-- | src/view/shell/bottom-bar/BottomBar.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index de1dc1703..a1502d2e9 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -6,7 +6,6 @@ import {BottomTabBarProps} from '@react-navigation/bottom-tabs' import {useSafeAreaInsets} from 'react-native-safe-area-context' import {observer} from 'mobx-react-lite' import {Text} from 'view/com/util/text/Text' -import {useStores} from 'state/index' import {useAnalytics} from 'lib/analytics/analytics' import {clamp} from 'lib/numbers' import { @@ -30,6 +29,8 @@ import {useModalControls} from '#/state/modals' import {useShellLayout} from '#/state/shell/shell-layout' import {useUnreadNotifications} from '#/state/queries/notifications/unread' import {emitSoftReset} from '#/state/events' +import {useSession} from '#/state/session' +import {useProfileQuery} from '#/state/queries/profile' type TabOptions = 'Home' | 'Search' | 'Notifications' | 'MyProfile' | 'Feeds' @@ -37,7 +38,7 @@ export const BottomBar = observer(function BottomBarImpl({ navigation, }: BottomTabBarProps) { const {openModal} = useModalControls() - const store = useStores() + const {currentAccount} = useSession() const pal = usePalette('default') const {_} = useLingui() const safeAreaInsets = useSafeAreaInsets() @@ -47,6 +48,7 @@ export const BottomBar = observer(function BottomBarImpl({ useNavigationTabState() const numUnreadNotifications = useUnreadNotifications() const {footerMinimalShellTransform} = useMinimalShellMode() + const {data: profile} = useProfileQuery({did: currentAccount?.did}) const onPressTab = React.useCallback( (tab: TabOptions) => { @@ -203,7 +205,7 @@ export const BottomBar = observer(function BottomBarImpl({ {borderColor: pal.text.color}, ]}> <UserAvatar - avatar={store.me.avatar} + avatar={profile?.avatar} size={27} // See https://github.com/bluesky-social/social-app/pull/1801: usePlainRNImage={true} @@ -212,7 +214,7 @@ export const BottomBar = observer(function BottomBarImpl({ ) : ( <View style={[styles.ctrlIcon, pal.text, styles.profileIcon]}> <UserAvatar - avatar={store.me.avatar} + avatar={profile?.avatar} size={28} // See https://github.com/bluesky-social/social-app/pull/1801: usePlainRNImage={true} |