Skip to content

Commit

Permalink
fix(ux): Add back button for AuthProfileScreen (#507)
Browse files Browse the repository at this point in the history
Adds back button when AuthProfileScreen is not the root of a StackNavigator.

Ps. AuthProfileScreen is StackNavigator root when the routeName is MyProfile.
  • Loading branch information
jouderianjr authored and Houssein Djirdeh committed Oct 19, 2017
1 parent 3ec1934 commit 5ef3260
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/auth/screens/auth-profile.screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ class AuthProfile extends Component {
hasInitialUser,
} = this.props;

const hasBackButton = navigation.state.routeName === 'AuthProfile';

const isPending = isPendingUser || isPendingOrgs;

return (
Expand All @@ -135,6 +137,8 @@ class AuthProfile extends Component {
/>
}
stickyTitle={user.login}
navigateBack={hasBackButton}
navigation={navigation}
showMenu
menuIcon="gear"
menuAction={() =>
Expand Down Expand Up @@ -163,7 +167,12 @@ class AuthProfile extends Component {
)}

{!isPending && (
<EntityInfo entity={user} orgs={orgs} navigation={navigation} locale={locale} />
<EntityInfo
entity={user}
orgs={orgs}
navigation={navigation}
locale={locale}
/>
)}

{!isPending && (
Expand Down

0 comments on commit 5ef3260

Please sign in to comment.