/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */

import React from 'react';
import { Left, Button, Body, Title, Right, Header, Icon } from 'native-base';
import styles from './style';

interface AppHeaderProps {
    toggleMenu?: () => void;
    title: string;
}

const HeaderCommon = (props: AppHeaderProps) => (
    <Header style={styles.header}>
        {props.toggleMenu && <Left>
            <Button
                transparent
                onPress={props.toggleMenu}
            >
                <Icon name='menu' style={styles.icon} />
            </Button>
        </Left>}
        <Body>
            <Title style={styles.themeText}>{props.title}</Title>
        </Body>
        {props.toggleMenu && <Right />}
    </Header>
)

export default HeaderCommon;
