forked from orodrigogo/nlwcopa-mobile-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Header.tsx
38 lines (32 loc) · 986 Bytes
/
Header.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
import { Text, HStack, Box } from 'native-base';
import { CaretLeft, Export } from 'phosphor-react-native';
import { ButtonIcon } from './ButtonIcon';
interface Props {
title: string;
showBackButton?: boolean;
showShareButton?: boolean;
}
export function Header({ title, showBackButton = false, showShareButton = false }: Props) {
const EmptyBoxSpace = () => (<Box w={6} h={6} />);
return (
<HStack w="full" h={24} bgColor="gray.800" alignItems="flex-end" pb={5} px={5}>
<HStack w="full" alignItems="center" justifyContent="space-between">
{
showBackButton
? <ButtonIcon icon={CaretLeft} />
: <EmptyBoxSpace />
}
<Text color="white" fontFamily="medium" fontSize="md" textAlign="center">
{title}
</Text>
{
showShareButton
?
<ButtonIcon icon={Export} />
:
<EmptyBoxSpace />
}
</HStack>
</HStack>
);
}