-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.tsx
42 lines (39 loc) · 1.05 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
import { StatusBar } from 'expo-status-bar'
import React from 'react'
import { Button, Paragraph, styled, Theme, XStack, YStack } from 'tamagui'
import Tamagui from './tamagui.config'
const MyStack = styled(XStack, {
flexDirection: 'row',
})
export default function App() {
return (
<Tamagui.Provider defaultTheme="light">
<MyStack flex={1} bc="$bg" ai="center" jc="center" space="$7">
<Theme name="light">
<TestComponent />
</Theme>
<Theme name="pink">
<TestComponent />
</Theme>
<Theme name="dark">
<TestComponent />
<Theme name="pink">
<TestComponent />
</Theme>
</Theme>
</MyStack>
<StatusBar style="auto" />
</Tamagui.Provider>
)
}
const TestComponent = () => {
return (
<YStack bc="$bg2" space ai="center" jc="center">
<YStack width={100} height={100} backgroundColor="$bg" />
<Paragraph $sm={{ color: 'red' }} size="$6">
Hello
</Paragraph>
<Button>Hello</Button>
</YStack>
)
}