diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-17 12:30:54 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-05-17 12:30:54 -0500 |
commit | 7aa1d9010e26da14a843efab0389386144cc978a (patch) | |
tree | 31ac7916fd7e1045bce0a078d67cc1164cc2e42f /src/view/shell/index.web.tsx | |
parent | 52c72d65326c2df6ada7547103c18ed41b51ebda (diff) | |
parent | 0ca096138a690f036828c49f9e95cf394b1a4339 (diff) | |
download | voidsky-7aa1d9010e26da14a843efab0389386144cc978a.tar.zst |
Merge branch 'main' into custom-algos
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}> |