// @flow import * as React from "react"; import {Body, Header, Icon, Left, Right, Title} from "native-base"; import {StyleSheet} from "react-native"; import {getStatusBarHeight} from "react-native-status-bar-height"; import Touchable from 'react-native-platform-touchable'; type Props = { backButton: boolean, rightMenu: React.Node, title: string, navigation: Object, }; export default class CustomHeader extends React.Component { static defaultProps = { backButton: false, rightMenu: , fontSize: 26, width: 30, }; render() { let button; if (this.props.backButton) button = this.props.navigation.goBack()}> ; else button = this.props.navigation.toggleDrawer()}> ; return (
{button} {this.props.title} {this.props.rightMenu}
); } }; // Fix header in status bar on Android const styles = StyleSheet.create({ header: { paddingTop: getStatusBarHeight(), height: 54 + getStatusBarHeight(), }, });