about summary refs log tree commit diff
path: root/src/view/shell/bottom-bar/BottomBar.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-08 12:34:10 -0600
committerGitHub <noreply@github.com>2023-11-08 10:34:10 -0800
commitf18b15241ab708f8c25a11937a875e361e9f1221 (patch)
tree07829ce8617cb858b4519d6f16c89c7e43f84d9c /src/view/shell/bottom-bar/BottomBar.tsx
parent5eadadffbf5475b233da7b1463e2345ff3e3cfce (diff)
downloadvoidsky-f18b15241ab708f8c25a11937a875e361e9f1221.tar.zst
Add modal state provider, replace usage except methods (#1833)
* Add modal state provider, replace usage except methods

* Replace easy spots

* Fix sticky spots

* Replace final usages

* Memorize context objects

* Add more warnings
Diffstat (limited to 'src/view/shell/bottom-bar/BottomBar.tsx')
-rw-r--r--src/view/shell/bottom-bar/BottomBar.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx
index d360ceead..fedfcdfca 100644
--- a/src/view/shell/bottom-bar/BottomBar.tsx
+++ b/src/view/shell/bottom-bar/BottomBar.tsx
@@ -24,12 +24,14 @@ import {styles} from './BottomBarStyles'
 import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode'
 import {useNavigationTabState} from 'lib/hooks/useNavigationTabState'
 import {UserAvatar} from 'view/com/util/UserAvatar'
+import {useModalControls} from '#/state/modals'
 
 type TabOptions = 'Home' | 'Search' | 'Notifications' | 'MyProfile' | 'Feeds'
 
 export const BottomBar = observer(function BottomBarImpl({
   navigation,
 }: BottomTabBarProps) {
+  const {openModal} = useModalControls()
   const store = useStores()
   const pal = usePalette('default')
   const safeAreaInsets = useSafeAreaInsets()
@@ -72,8 +74,8 @@ export const BottomBar = observer(function BottomBarImpl({
     onPressTab('MyProfile')
   }, [onPressTab])
   const onLongPressProfile = React.useCallback(() => {
-    store.shell.openModal({name: 'switch-account'})
-  }, [store])
+    openModal({name: 'switch-account'})
+  }, [openModal])
 
   return (
     <Animated.View