-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
152 lines (147 loc) · 3.84 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
142
143
144
145
146
147
148
149
150
151
152
import { config } from "@gluestack-ui/config";
import { Alert, Box, GluestackUIProvider, Text } from "@gluestack-ui/themed";
import { ScrollView } from "react-native";
import Gradient from "./assets/Icons/Gradient";
import DocumentData from "./assets/Icons/DocumentData";
import LightBulbPerson from "./assets/Icons/LightbulbPerson";
import Rocket from "./assets/Icons/Rocket";
import Logo from "./assets/Icons/Logo";
export default function App() {
return (
<GluestackUIProvider config={config}>
<Home />
</GluestackUIProvider>
);
}
const Home = () => {
return <Container />;
};
const FeatureCard = ({ iconSvg: IconSvg, name, desc }: any) => {
return (
<Box
flexDirection="column"
borderWidth={1}
borderColor="$borderDark700"
sx={{
_web: {
flex: 1,
},
}}
m="$2"
p="$4"
rounded="$md"
>
{/* Alias autocompletion doesnt work at all */}
<Box alignItems="center" display="flex" flexDirection="row"> {/* Autocompletion without aliases doesnt work on Box */}
{/* <Image source={iconSvg} alt="document" width={22} height={22} /> */}
<Text>
<IconSvg />
</Text>
<Alert /> {/* Autocompletion without aliases work on Alert */}
<Text fontSize={22} color="$white" fontWeight="500" ml="$2">
{name}
</Text>
</Box>
<Text color="$textDark400" mt="$2">
{desc}
</Text>
</Box>
);
};
const Container = () => {
return (
<Box flex={1} backgroundColor="$black">
<ScrollView
style={{ height: "100%" }}
contentContainerStyle={{ flexGrow: 1 }}
>
<Box
position="absolute"
sx={{
"@base": {
h: 500,
w: 500,
},
"@lg": {
h: 700,
w: 700,
},
}}
>
<Gradient />
</Box>
<Box
height="60%"
sx={{
"@base": {
my: "$16",
mx: "$5",
height: "80%",
},
"@lg": {
my: "$24",
mx: "$32",
},
}}
justifyContent="space-between"
alignItems="center"
>
<Box
bg="#64748B33"
py="$2"
px="$6"
rounded="$full"
alignItems="center"
marginTop={20}
sx={{
"@base": {
flexDirection: "column",
},
"@sm": {
flexDirection: "row",
},
"@md": { alignSelf: "flex-start" },
}}
>
<Text color="$white" fontWeight="$normal">
Get started by editing
</Text>
<Text color="$white" fontWeight="$medium" ml="$2">
App.tsx
</Text>
</Box>
<Alert />
<Box justifyContent="center" alignItems="center">
<Logo />
</Box>
<Box
sx={{
"@base": {
flexDirection: "column",
},
"@md": {
flexDirection: "row",
},
}}
>
<FeatureCard
iconSvg={DocumentData}
name="Docs"
desc="Find in-depth information about gluestack features and API."
/>
<FeatureCard
iconSvg={LightBulbPerson}
name="Learn"
desc="Learn about gluestack in an interactive course with quizzes!"
/>
<FeatureCard
iconSvg={Rocket}
name="Deploy"
desc="Instantly drop your gluestack site to a shareable URL with vercel."
/>
</Box>
</Box>
</ScrollView>
</Box>
);
};