()
| 13 | const Stack = createStackNavigator(); |
| 14 | |
| 15 | export default function Root() { |
| 16 | const cardStyleInterpolator = |
| 17 | Platform.OS === 'android' |
| 18 | ? CardStyleInterpolators.forFadeFromBottomAndroid |
| 19 | : CardStyleInterpolators.forHorizontalIOS; |
| 20 | return ( |
| 21 | <View style={styles.stackWrapper}> |
| 22 | <Stack.Navigator |
| 23 | screenOptions={() => ({ |
| 24 | cardStyleInterpolator, |
| 25 | header: ({ navigation, route, options, back }) => ( |
| 26 | <Appbar.Header elevated> |
| 27 | {back ? ( |
| 28 | <Appbar.BackAction onPress={() => navigation.goBack()} /> |
| 29 | ) : (navigation as any).openDrawer ? ( |
| 30 | <Appbar.Action |
| 31 | icon="menu" |
| 32 | isLeading |
| 33 | onPress={() => |
| 34 | (navigation as any as DrawerNavigationProp<{}>).openDrawer() |
| 35 | } |
| 36 | /> |
| 37 | ) : null} |
| 38 | <Appbar.Content title={options.title || route.name} /> |
| 39 | </Appbar.Header> |
| 40 | ), |
| 41 | })} |
| 42 | > |
| 43 | <Stack.Screen |
| 44 | name="ExampleList" |
| 45 | component={ExampleList} |
| 46 | options={{ |
| 47 | title: 'Examples', |
| 48 | }} |
| 49 | /> |
| 50 | {(Object.keys(examples) as Array<keyof typeof examples>).map((id) => { |
| 51 | return ( |
| 52 | <Stack.Screen |
| 53 | key={id} |
| 54 | name={id} |
| 55 | component={examples[id]} |
| 56 | options={{ |
| 57 | title: examples[id].title, |
| 58 | headerShown: id !== 'themingWithReactNavigation', |
| 59 | }} |
| 60 | /> |
| 61 | ); |
| 62 | })} |
| 63 | </Stack.Navigator> |
| 64 | </View> |
| 65 | ); |
| 66 | } |
| 67 | |
| 68 | const styles = StyleSheet.create({ |
| 69 | stackWrapper: { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…