Hide main menu drawer on click outside

zio/stable
Paul Frazee 2022-12-13 15:01:14 -06:00
parent e8eb3e131c
commit 9a99c9c8c8
1 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import {
StyleSheet, StyleSheet,
Text, Text,
TouchableOpacity, TouchableOpacity,
TouchableWithoutFeedback,
useColorScheme, useColorScheme,
useWindowDimensions, useWindowDimensions,
View, View,
@ -394,7 +395,10 @@ export const MobileShell: React.FC = observer(() => {
)} )}
</ScreenContainer> </ScreenContainer>
{isMenuActive || menuSwipingDirection !== 0 ? ( {isMenuActive || menuSwipingDirection !== 0 ? (
<TouchableWithoutFeedback
onPress={() => store.shell.setMainMenuOpen(false)}>
<Animated.View style={[styles.screenMask, menuSwipeOpacity]} /> <Animated.View style={[styles.screenMask, menuSwipeOpacity]} />
</TouchableWithoutFeedback>
) : undefined} ) : undefined}
<Animated.View style={[styles.menuDrawer, menuSwipeTransform]}> <Animated.View style={[styles.menuDrawer, menuSwipeTransform]}>
<Menu <Menu