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
This commit is contained in:
parent
5eadadffbf
commit
f18b15241a
70 changed files with 634 additions and 498 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue