-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
141 lines (125 loc) · 4.4 KB
/
App.tsx
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import Ionicons from '@expo/vector-icons/Ionicons';
import { SafeAreaView, ScrollView } from 'react-native';
import { Button } from 'components/Button';
import { Flex } from 'components/Flex';
import { HorizontalScroll } from 'components/HorizontalScroll';
import { SegmentedControl } from 'components/SegmentedControl';
import { TabBar } from 'components/TabBar';
import { Table } from 'components/Table';
import { Textarea } from 'components/Textarea';
import { TextInput } from 'components/TextInput';
import { TopNavigation } from 'components/TopNavigation';
import { useActionSheet } from 'hooks/useActionSheet';
import { theme } from 'theme';
function App() {
const { showActionSheetWithOptions } = useActionSheet();
return (
<SafeAreaView
style={{ backgroundColor: theme.palette.neutral[600], height: '100%', width: '100%' }}
>
<ScrollView>
<TopNavigation
left={{
icon: <Ionicons name="chevron-back" color={theme.palette.primary.main} size={28} />,
onPress: () => console.log('left press'),
title: 'Back',
}}
right={{ onPress: () => console.log('right press'), title: 'Save' }}
title="Settings"
/>
<SegmentedControl
controls={[{ title: 'Option 1' }, { title: 'Option 2' }, { title: 'Option 3' }]}
selectedIndex={0}
onChange={() => {
console.log('here');
}}
/>
<Flex my={4} width="100%">
<HorizontalScroll>
<Button size="small" title="Filled Small" variant="filled" />
<Button size="small" title="Gray Small" variant="gray" />
<Button size="small" title="Plain Small" variant="plain" />
<Button size="small" title="Tinted Small" variant="tinted" />
</HorizontalScroll>
</Flex>
<Flex my={4}>
<HorizontalScroll>
<Button title="Filled Medium" variant="filled" />
<Button title="Gray Medium" variant="gray" />
<Button title="Plain Medium" variant="plain" />
<Button title="Tinted Medium" variant="tinted" />
</HorizontalScroll>
</Flex>
<Flex my={4}>
<HorizontalScroll>
<Button size="large" title="Filled Large" variant="filled" />
<Button size="large" title="Gray Large" variant="gray" />
<Button size="large" title="Plain Large" variant="plain" />
<Button size="large" title="Tinted Large" variant="tinted" />
</HorizontalScroll>
</Flex>
<Flex my={4}>
<TextInput error helperText="Search is required" value="Search" />
</Flex>
<Flex my={4}>
<Textarea
numberOfLines={3}
value={`Textarea content\nTextarea content\nTextarea content`}
/>
</Flex>
<Flex my={4}>
<Table
header="Networks"
rows={[
{
rightIcon: true,
title: 'Z17AHW',
subtitle: 'Test subtitle',
},
{
left: <Ionicons name="add-circle" size={24} />,
rightText: '12345',
title: 'HP24',
},
{ title: 'My Wifi' },
]}
/>
</Flex>
<Flex my={4}>
<Button
title="Action Sheet"
onPress={() =>
showActionSheetWithOptions({
cancel: { onPress: () => console.log('cancel'), title: 'Cancel' },
options: [{ onPress: () => console.log('save'), title: 'Save' }],
})
}
/>
</Flex>
<TabBar>
<TabBar.Tab
icon={<Ionicons name="list-circle-outline" size={28} />}
onPress={() => {
console.log('here 1');
}}
/>
<TabBar.Tab
icon={<Ionicons name="checkmark-circle-outline" size={28} />}
onPress={() => console.log('here 2')}
/>
<TabBar.Tab
icon={<Ionicons name="stats-chart-outline" size={28} />}
onPress={() => console.log('here 3')}
/>
<TabBar.Tab
icon={<Ionicons name="timer-outline" size={28} />}
onPress={() => {
console.log('here 4');
}}
/>
</TabBar>
</ScrollView>
</SafeAreaView>
);
}
export default App;