| 23 | type Params = { drawerLockMode: 'unlocked' | 'locked-open' | 'locked-closed' }; |
| 24 | |
| 25 | const MyNavScreen = ({ |
| 26 | navigation, |
| 27 | banner, |
| 28 | }: { |
| 29 | navigation: NavigationDrawerProp<NavigationRoute, Params>; |
| 30 | banner: string; |
| 31 | }) => { |
| 32 | let theme = useTheme(); |
| 33 | |
| 34 | return ( |
| 35 | <ScrollView> |
| 36 | <SafeAreaView forceInset={{ top: 'always' }}> |
| 37 | <View |
| 38 | style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} |
| 39 | > |
| 40 | <SampleText>{banner}</SampleText> |
| 41 | </View> |
| 42 | <Themed.TextInput |
| 43 | style={{ |
| 44 | flex: 1, |
| 45 | height: 35, |
| 46 | marginHorizontal: 10, |
| 47 | marginVertical: 10, |
| 48 | borderWidth: StyleSheet.hairlineWidth, |
| 49 | borderColor: ThemeColors[theme].bodyBorder, |
| 50 | textAlign: 'center', |
| 51 | }} |
| 52 | placeholder="Focus this TextInput then drag the drawer!" |
| 53 | /> |
| 54 | <Button onPress={() => navigation.openDrawer()} title="Open drawer" /> |
| 55 | <Button |
| 56 | onPress={() => navigation.toggleDrawer()} |
| 57 | title="Toggle drawer" |
| 58 | /> |
| 59 | <Button |
| 60 | onPress={() => { |
| 61 | navigation.openDrawer(); |
| 62 | navigation.closeDrawer(); |
| 63 | }} |
| 64 | title="Open and immediately close" |
| 65 | /> |
| 66 | <Button |
| 67 | onPress={() => { |
| 68 | navigation.closeDrawer(); |
| 69 | navigation.openDrawer(); |
| 70 | }} |
| 71 | title="Close and immediately open" |
| 72 | /> |
| 73 | <Button |
| 74 | onPress={() => { |
| 75 | navigation.openDrawer(); |
| 76 | setTimeout(() => { |
| 77 | navigation.closeDrawer(); |
| 78 | }, 150); |
| 79 | }} |
| 80 | title="Open then close drawer shortly after" |
| 81 | /> |
| 82 | <Button |