forked from mrzachnugent/react-native-reusables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
39 lines (38 loc) · 1.13 KB
/
index.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
import React from 'react';
import { View } from 'react-native';
import { Alert, AlertDescription, AlertTitle } from '~/components/ui/alert';
import { Label } from '~/components/ui/label';
import { Switch } from '~/components/ui/switch';
export default function SwitchScreen() {
const [value, setValue] = React.useState(false);
return (
<>
<View className='p-6 w-full'>
<Alert icon='Code' className='max-w-xl'>
<AlertTitle>FYI</AlertTitle>
<AlertDescription>
This reusable does not use "rn-primitives"
</AlertDescription>
</Alert>
</View>
<View className='flex-1 items-center justify-center p-6'>
<View className='flex-row items-center gap-5'>
<Switch
aria-labelledbyledBy='switchLabel'
value={value}
onValueChange={setValue}
/>
<Label
onPress={() => {
setValue((prev) => !prev);
}}
nativeID='switchLabel'
className='text-xl pb-2'
>
Airplane mode
</Label>
</View>
</View>
</>
);
}