forked from orodrigogo/nlwcopa-mobile-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PoolCard.tsx
57 lines (51 loc) · 1.26 KB
/
PoolCard.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
import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
import { Heading, HStack, Text, VStack } from 'native-base';
import { Participants, ParticipantProps } from './Participants';
export interface PoolPros {
id: string;
code: string;
title: string;
ownerId: string;
createdAt: string;
owner: {
name: string;
},
participants: ParticipantProps[];
_count: {
participants: number;
}
}
interface Props extends TouchableOpacityProps {
data: PoolPros;
}
export function PoolCard({ data, ...rest }: Props) {
return (
<TouchableOpacity {...rest}>
<HStack
w="full"
h={20}
bgColor="gray.800"
borderBottomWidth={3}
borderBottomColor="yellow.500"
justifyContent="space-between"
alignItems="center"
rounded="sm"
mb={3}
p={4}
>
<VStack>
<Heading color="white" fontSize="md" fontFamily="heading">
{data.title}
</Heading>
<Text color="gray.200" fontSize="xs">
Criado por {data.owner.name}
</Text>
</VStack>
<Participants
count={data._count.participants}
participants={data.participants}
/>
</HStack>
</TouchableOpacity>
);
}