This commit is contained in:
Mike Fitzpatrick
2019-08-12 17:44:01 -04:00
parent 0f618fdd78
commit f0460a1b76
21 changed files with 432 additions and 78 deletions

View File

@@ -24,9 +24,9 @@ export default class AppHeader extends Component {
return (
<Header
placement="left"
leftComponent={<HeaderContentRight navigation={navigation} />}
centerComponent={<HeaderTitle navigation={navigation} />}
rightComponent={<HeaderContentLeft navigation={navigation} />}
leftComponent={<HeaderContentLeft navigation={navigation} />}
rightComponent={<HeaderContentRight navigation={navigation} />}
/>
);
}

View File

@@ -32,7 +32,11 @@ export default function HeaderContentLeft({
return <BackIcon action={_goBack} />;
}
return <EventsIcon action={hasMultipleEvents ? _showEvents : null} />;
if (hasMultipleEvents) {
return <EventsIcon action={_showEvents} />;
}
return null;
}
HeaderContentLeft.propTypes = {

View File

@@ -8,7 +8,7 @@ export default function HeaderContentRight({ hideUserProfileButton, navigation }
return null;
}
return <UserProfileButton />;
return <UserProfileButton navigation={navigation} />;
}
HeaderContentRight.propTypes = {

View File

@@ -8,6 +8,7 @@ import EventTitle from './EventTitle/EventTitle.container.js';
import styles from './HeaderTitle.styles.js';
const STRINGS = {
EVENTS: 'Events',
PROFILE: 'Profile',
};
@@ -34,7 +35,7 @@ export default function HeaderTitle({
if (activeRoute === 'Events') {
return (
<TouchableOpacity onPress={_goBack}>
<Text style={styles.screenHeader}>{STRINGS.PROFILE}</Text>
<Text style={styles.screenHeader}>{STRINGS.EVENTS}</Text>
</TouchableOpacity>
);
}

View File

@@ -13,8 +13,12 @@ export default function UserProfileButton({
navigation,
}) {
const _goToProfile = () => {
navigation.navigate('Profile');
return false;
if (isRegisteredAccount) {
navigation.navigate('Profile');
return false;
}
navigation.navigate('SignInOrRegister');
};
return (