Fakultas Ilmu Komputer UI

Commit 7acd7579 authored by jahnsmichael's avatar jahnsmichael
Browse files

[CHORES] add navigationto ProfilePage

parent e3d55a88
import {AppContext} from 'contexts';
import { AppContext } from 'contexts';
import { useNavigation } from '@react-navigation/native';
import React, {useContext} from 'react';
import React, { useContext } from 'react';
import styled from 'styled-components/native';
import {Image} from 'react-native';
import {Button, Text, Box} from 'components';
import { Image } from 'react-native';
import { Button, Text, Box } from 'components';
interface HeaderProps {
isHome?: boolean;
......@@ -25,19 +25,24 @@ const Header = ({
<BackgroundMain>
<HeaderMain>
<ChildrenContent>
{isHome? (
{isHome ? (
<>
<Box
grow={1}
/>
<FlexControl>
<FlexControl >
<Image
style={{borderRadius: 100, width: 80, height: 80}}
style={{ borderRadius: 100, width: 80, height: 80 }}
source={require('assets/icons/user-placeholder.png')}
/>
<TextView>
<Text isBold type={Text.StyleType.Larger} >{`Halo, ${greetingName} !`}</Text>
<Text type={Text.StyleType.Medium} >Semangat berantas TB</Text>
<TouchableText
onPress={() => global.isAuthenticated ? navigation.navigate("profile") : navigation.navigate("login")}
>
<Text>Lihat Profile</Text>
</TouchableText>
</TextView>
</FlexControl>
</>
......@@ -51,7 +56,7 @@ const Header = ({
<Button
width="30px"
type={Button.Type.Outline}
onPress={() => global.isAuthenticated? navigation.navigate("home"): navigation.navigate("login")}
onPress={() => global.isAuthenticated ? navigation.navigate("home") : navigation.navigate("login")}
>
Beranda
</Button>
......@@ -126,4 +131,10 @@ const HeaderSecondary = styled.SafeAreaView`
border-top-left-radius: 80px;
`;
const TouchableText = styled.TouchableOpacity`
height: auto;
width: auto;
border-width: 0px;
`;
export default Header;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment