diff options
author | Jaz <ericvolp12@gmail.com> | 2023-05-17 21:19:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 21:19:20 -0700 |
commit | 7f76c2d67e62ba2d10e8b17673a7bbcf7248564f (patch) | |
tree | ece7f72b04ee4bb39d4118b0b520683deddaa972 /src/view/shell/index.web.tsx | |
parent | ac3a95dc7228ad3d1d1cb7c5e7e26968009173bb (diff) | |
parent | 0ca096138a690f036828c49f9e95cf394b1a4339 (diff) | |
download | voidsky-7f76c2d67e62ba2d10e8b17673a7bbcf7248564f.tar.zst |
Merge branch 'main' into inherit_system_theme
Diffstat (limited to 'src/view/shell/index.web.tsx')
-rw-r--r-- | src/view/shell/index.web.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx index 349376436..68ce370ed 100644 --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, {useEffect} from 'react' import {observer} from 'mobx-react-lite' import {View, StyleSheet, TouchableOpacity} from 'react-native' import {useStores} from 'state/index' @@ -14,11 +14,21 @@ import {RoutesContainer, FlatNavigator} from '../../Navigation' import {DrawerContent} from './Drawer' import {useWebMediaQueries} from '../../lib/hooks/useWebMediaQueries' import {BottomBarWeb} from './bottom-bar/BottomBarWeb' +import {useNavigation} from '@react-navigation/native' +import {NavigationProp} from 'lib/routes/types' const ShellInner = observer(() => { const store = useStores() const {isDesktop} = useWebMediaQueries() + const navigator = useNavigation<NavigationProp>() + + useEffect(() => { + navigator.addListener('state', () => { + store.shell.closeAnyActiveElement() + }) + }, [navigator, store.shell]) + return ( <> <View style={s.hContentRegion}> |