-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathButton.tsx
34 lines (32 loc) · 795 Bytes
/
Button.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
import { Button as ButtonNativeBase, IButtonProps, Text } from 'native-base';
interface Props extends IButtonProps {
title: string;
type?: 'PRIMARY' | 'SECONDARY';
}
export function Button({ title, type = 'PRIMARY', ...rest }: Props) {
return (
<ButtonNativeBase
w="full"
h={14}
rounded="sm"
fontSize="md"
textTransform="uppercase"
bg={type === 'SECONDARY' ? 'red.500' : "yellow.500"}
_pressed={{
bg: type === 'SECONDARY' ? "red.400" : "yellow.600"
}}
_loading={{
_spinner: { color: "black" }
}}
{...rest}
>
<Text
fontSize="sm"
fontFamily="heading"
color={type === 'SECONDARY' ? 'white' : "black"}
>
{title}
</Text>
</ButtonNativeBase >
);
}