import React from 'react'; import PropTypes from 'prop-types'; import { Text, TouchableOpacity } from 'react-native'; import EventTitle from './EventTitle/EventTitle.container.js'; import styles from './HeaderTitle.styles.js'; const STRINGS = { PROFILE: 'Profile', }; export default function HeaderTitle({ activeRoute, hasActiveEvent, hasMultipleEvents, navigation, }) { const _goBack = () => { if (hasActiveEvent) { navigation.goBack(); return false; } console.log('nowhere to go...'); }; const _showEvents = () => { navigation.navigate('Events'); return false; }; if (activeRoute === 'Events') { return ( {STRINGS.PROFILE} ); } if (activeRoute === 'Profile') { return {STRINGS.PROFILE}; } return ; } HeaderTitle.propTypes = { activeRoute: PropTypes.string.isRequired, hasActiveEvent: PropTypes.bool, hasMultipleEvents: PropTypes.bool.isRequired, }; HeaderTitle.defaultProps = { hasActiveEvent: false, };