-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathApp.tsx
More file actions
82 lines (75 loc) · 2.39 KB
/
App.tsx
File metadata and controls
82 lines (75 loc) · 2.39 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
77
78
79
80
81
82
/* eslint-disable react-native/no-inline-styles */
import { NavigationContainer, useNavigation } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import React from 'react';
import { StatusBar, TouchableOpacity } from 'react-native';
import InputExample from './examples/input/InputExample';
import PickerExamples from './examples/picker/PickerExamples';
import TxtExample from './examples/txt/TxtExample';
import FormExample from './examples/form/FormExample';
import StyleThemeExample from './examples/useStylesAndTheme/StylesThemeExample';
import { Container, createStyles, Txt } from './src';
const Stack = createStackNavigator();
const useStyles = createStyles(() => ({
root: { backgroundColor: 'white' },
exRow: {
padding: 16,
borderBottomWidth: 1,
borderColor: '#ddd',
flexDirection: 'row',
alignItems: 'center',
backgroundColor: '#f8f8f8',
},
exDot: {
width: 8,
height: 8,
borderRadius: 8,
backgroundColor: '#416ce1',
marginRight: 12,
},
}));
const ExRow = ({ name, nested }: any) => {
const styles = useStyles({ nested });
const navigation = useNavigation();
return (
<TouchableOpacity
onPress={() => navigation.navigate(name)}
style={styles.exRow}
>
<Container style={styles.exDot} />
<Txt style={{ fontSize: 16 }}>{name}</Txt>
</TouchableOpacity>
);
};
const Initial = () => {
const styles = useStyles();
return (
<Container grow style={styles.root}>
<ExRow name="Styles and Theme" />
<ExRow name="Txt" />
<ExRow name="Picker" />
<ExRow name="Input" />
<ExRow name="Form" />
</Container>
);
};
export default function App() {
return (
<Container grow>
<StatusBar hidden />
<NavigationContainer>
<Stack.Navigator
initialRouteName="Examples"
screenOptions={{ cardStyle: { backgroundColor: '#fff' } }}
>
<Stack.Screen name="Examples" component={Initial} />
<Stack.Screen name="Styles and Theme" component={StyleThemeExample} />
<Stack.Screen name="Txt" component={TxtExample} />
<Stack.Screen name="Picker" component={PickerExamples} />
<Stack.Screen name="Input" component={InputExample} />
<Stack.Screen name="Form" component={FormExample} />
</Stack.Navigator>
</NavigationContainer>
</Container>
);
}