-
-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathindex.tsx
More file actions
76 lines (70 loc) · 2.25 KB
/
index.tsx
File metadata and controls
76 lines (70 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import React from 'react';
import { ScrollView } from 'react-native';
import {
NavigationContainer,
NavigationIndependentTree,
} from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import TabsScenarioGroup from './tabs';
import SplitScenarioGroup from './split';
import StackV5ScenarioGroup from './stack-v5';
import StackV4ScenarioGroup from './stack-v4';
import FormSheetScenarioGroup from './form-sheet';
import { ScenarioButton } from '@apps/tests/shared/ScenarioButton';
import ScenarioSelectionScreen from '@apps/tests/shared/ScenarioScreen';
export const COMPONENT_SCENARIOS = {
Tabs: TabsScenarioGroup,
Split: SplitScenarioGroup,
StackV5: StackV5ScenarioGroup,
StackV4: StackV4ScenarioGroup,
FormSheet: FormSheetScenarioGroup,
} as const;
type ParamsList = { [k: keyof typeof COMPONENT_SCENARIOS]: undefined } & {
Home: undefined;
};
function HomeScreen() {
return (
<ScrollView contentInsetAdjustmentBehavior="automatic"
testID="single-feature-tests-scrollview">
{Object.entries(COMPONENT_SCENARIOS).map(([key, scenarioGroup]) => (
<ScenarioButton
key={key}
title={scenarioGroup.name}
route={key}
details={scenarioGroup.details}
testID={`single-feature-tests-${scenarioGroup.name}`}
/>
))}
</ScrollView>
);
}
const Stack = createNativeStackNavigator<ParamsList>();
export default function App() {
return (
<NavigationIndependentTree>
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{
headerShown: true,
headerLargeTitleEnabled: true,
headerTitle: 'Scenarios',
}}
/>
{Object.entries(COMPONENT_SCENARIOS).map(([key, scenarioGroup]) => (
<Stack.Screen name={key}>
{() => (
<ScenarioSelectionScreen
key={key}
scenarioGroup={scenarioGroup}
/>
)}
</Stack.Screen>
))}
</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
);
}