-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
88 lines (83 loc) · 2.11 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
import {
GluestackUIProvider,
ChevronDownIcon,
Icon,
Select,
SelectBackdrop,
SelectContent,
SelectDragIndicator,
SelectDragIndicatorWrapper,
SelectIcon,
SelectInput,
SelectItem,
SelectPortal,
SelectTrigger,
AlertIcon,
AlertText,
InfoIcon,
Alert,
Button,
ButtonText,
} from '@gluestack-ui/themed';
import {config} from '@gluestack-ui/config';
import React from 'react';
const SelectExample = () => {
return (
<Select mt="$16">
<SelectTrigger variant="outline" size="md">
<SelectInput placeholder="Select option" />
<SelectIcon mr="$3">
<Icon as={ChevronDownIcon} />
</SelectIcon>
</SelectTrigger>
<SelectPortal>
<SelectBackdrop />
<SelectContent>
<SelectDragIndicatorWrapper>
<SelectDragIndicator />
</SelectDragIndicatorWrapper>
<SelectItem label="UX Research" value="ux" />
<SelectItem label="Web Development" value="web" />
<SelectItem
label="Cross Platform Development Process"
value="Cross Platform Development Process"
/>
<SelectItem label="UI Designing" value="ui" isDisabled={true} />
<SelectItem label="Backend Development" value="backend" />
</SelectContent>
</SelectPortal>
</Select>
);
};
const AlertExample = () => {
const [showAlert, setShowAlert] = React.useState(false);
return (
<>
<Button
mt={'$4'}
size="lg"
variant="solid"
action="primary"
onPress={() => setShowAlert(!showAlert)}>
<ButtonText>SHOW ALERT</ButtonText>
</Button>
{showAlert && (
<Alert mx="$2.5" action="info" variant="solid">
<AlertIcon as={InfoIcon} mr="$3" />
<AlertText>
We have updated our terms of service. Please review and accept to
continue using our service.
</AlertText>
</Alert>
)}
</>
);
};
export default function App() {
return (
<GluestackUIProvider config={config}>
<SelectExample />
<AlertExample />
</GluestackUIProvider>
);
}