diff options
author | Eric Bailey <git@esb.lol> | 2023-11-08 12:34:10 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-08 10:34:10 -0800 |
commit | f18b15241ab708f8c25a11937a875e361e9f1221 (patch) | |
tree | 07829ce8617cb858b4519d6f16c89c7e43f84d9c /src/view/shell/desktop/RightNav.tsx | |
parent | 5eadadffbf5475b233da7b1463e2345ff3e3cfce (diff) | |
download | voidsky-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/desktop/RightNav.tsx')
-rw-r--r-- | src/view/shell/desktop/RightNav.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/view/shell/desktop/RightNav.tsx b/src/view/shell/desktop/RightNav.tsx index 84d7d7854..a4b3e5746 100644 --- a/src/view/shell/desktop/RightNav.tsx +++ b/src/view/shell/desktop/RightNav.tsx @@ -13,6 +13,7 @@ import {useStores} from 'state/index' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {pluralize} from 'lib/strings/helpers' import {formatCount} from 'view/com/util/numeric/format' +import {useModalControls} from '#/state/modals' export const DesktopRightNav = observer(function DesktopRightNavImpl() { const store = useStores() @@ -83,12 +84,13 @@ export const DesktopRightNav = observer(function DesktopRightNavImpl() { const InviteCodes = observer(function InviteCodesImpl() { const store = useStores() const pal = usePalette('default') + const {openModal} = useModalControls() const {invitesAvailable} = store.me const onPress = React.useCallback(() => { - store.shell.openModal({name: 'invite-codes'}) - }, [store]) + openModal({name: 'invite-codes'}) + }, [openModal]) return ( <TouchableOpacity style={[styles.inviteCodes, pal.border]} |