Skip to content

Commit

Permalink
Added ability to dismiss keyboard when tapping screen (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjstnlee authored Mar 15, 2024
1 parent 14567de commit 0250b59
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import { Stack } from 'expo-router';
import { Keyboard, TouchableWithoutFeedback } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import { AuthContextProvider } from '../utils/AuthContext';
import ToastComponent from '../components/Toast/Toast';

function StackLayout() {
return (
<SafeAreaProvider>
<AuthContextProvider>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="settings" options={{ headerShown: false }} />
<Stack.Screen name="auth" options={{ headerShown: false }} />
</Stack>
</AuthContextProvider>
<ToastComponent />
</SafeAreaProvider>
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<SafeAreaProvider>
<AuthContextProvider>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="settings" options={{ headerShown: false }} />
<Stack.Screen name="auth" options={{ headerShown: false }} />
</Stack>
</AuthContextProvider>
<ToastComponent />
</SafeAreaProvider>
</TouchableWithoutFeedback>
);
}

Expand Down

0 comments on commit 0250b59

Please sign in to comment.