Skip to content

Commit 37d895c

Browse files
committed
chore: ✨ added Avatar and Button examples
1 parent 2031617 commit 37d895c

File tree

1 file changed

+54
-3
lines changed

1 file changed

+54
-3
lines changed

.ondevice/AppRoot.tsx

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
11
import { createDrawerNavigator } from '@react-navigation/drawer';
22
import React from 'react';
33
import { Avatar, Badge, Box, Button, Icon, useTheme } from '../src';
4-
import { Check, Clock, Close } from '../src/assets';
4+
import { CaretRight, Check, Clock, Close, DefaultUser } from '../src/assets';
55

66
function ButtonScreen() {
77
const tailwind = useTheme();
88
return (
99
<Box
1010
style={tailwind.style('flex-1 justify-center items-center bg-white-900')}
1111
>
12-
<Button>Continue</Button>
12+
<Button
13+
style={tailwind.style('my-1')}
14+
suffix={<Icon icon={<CaretRight />} />}
15+
>
16+
Continue
17+
</Button>
18+
<Button style={tailwind.style('my-1')} variant="outline">
19+
Get Free Resource
20+
</Button>
21+
<Button
22+
style={({ pressed }) => [
23+
tailwind.style(
24+
`my-1 bg-violet-600 ${pressed ? 'bg-violet-800' : ''}`
25+
),
26+
]}
27+
>
28+
Reply
29+
</Button>
30+
<Button
31+
prefix={<Icon icon={<DefaultUser />} />}
32+
style={({ pressed }) => [
33+
tailwind.style(`my-1 bg-green-600 ${pressed ? 'bg-green-800' : ''}`),
34+
]}
35+
>
36+
Sign In
37+
</Button>
38+
<Button
39+
variant="subtle"
40+
icon={<Icon icon={<CaretRight />} />}
41+
style={tailwind.style('my-1')}
42+
></Button>
1343
</Box>
1444
);
1545
}
@@ -20,7 +50,28 @@ function AvatarScreen() {
2050
<Box
2151
style={tailwind.style('flex-1 justify-center items-center bg-white-900')}
2252
>
23-
<Avatar src={{ uri: 'https://i.pravatar.cc/300??img=9' }} />
53+
<Avatar style={tailwind.style('my-1')} />
54+
<Avatar style={tailwind.style('my-1')} squared />
55+
<Avatar
56+
style={tailwind.style('my-1')}
57+
src={{ uri: 'https://i.pravatar.cc/300??img=9' }}
58+
/>
59+
<Avatar name="Sandeep Prabhakaran" style={tailwind.style('my-1')} />
60+
<Avatar
61+
style={tailwind.style('my-1')}
62+
src={{ uri: 'https://i.pravatar.cc/300??img=9' }}
63+
status="active"
64+
/>
65+
<Avatar
66+
style={tailwind.style('my-1')}
67+
src={{ uri: 'https://i.pravatar.cc/300??img=9' }}
68+
status="away"
69+
/>
70+
<Avatar
71+
style={tailwind.style('my-1')}
72+
src={{ uri: 'https://i.pravatar.cc/300??img=9' }}
73+
status="sleep"
74+
/>
2475
</Box>
2576
);
2677
}

0 commit comments

Comments
 (0)