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