mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-24 05:42:33 +03:00
Added click action for user avatar on side menu
This commit is contained in:
parent
c2b5010255
commit
4500f5f964
@ -109,7 +109,6 @@ class SideMenuView extends Component {
|
|||||||
username={currentAccount.username}
|
username={currentAccount.username}
|
||||||
size="xl"
|
size="xl"
|
||||||
style={styles.userAvatar}
|
style={styles.userAvatar}
|
||||||
noAction
|
|
||||||
/>
|
/>
|
||||||
<View style={styles.userInfoWrapper}>
|
<View style={styles.userInfoWrapper}>
|
||||||
{currentAccount.display_name && (
|
{currentAccount.display_name && (
|
||||||
|
@ -26,15 +26,17 @@ class UserAvatarView extends Component {
|
|||||||
|
|
||||||
// Component Functions
|
// Component Functions
|
||||||
_handleOnAvatarPress = username => {
|
_handleOnAvatarPress = username => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch, currentUsername } = this.props;
|
||||||
|
|
||||||
|
const routeName = currentUsername === username ? ROUTES.TABBAR.PROFILE : ROUTES.SCREENS.PROFILE;
|
||||||
|
|
||||||
const navigateAction = NavigationActions.navigate({
|
const navigateAction = NavigationActions.navigate({
|
||||||
routeName: ROUTES.SCREENS.PROFILE,
|
routeName,
|
||||||
params: {
|
params: {
|
||||||
username,
|
username,
|
||||||
},
|
},
|
||||||
key: username,
|
key: username,
|
||||||
action: NavigationActions.navigate({ routeName: ROUTES.SCREENS.PROFILE }),
|
action: NavigationActions.navigate({ routeName }),
|
||||||
});
|
});
|
||||||
dispatch(navigateAction);
|
dispatch(navigateAction);
|
||||||
};
|
};
|
||||||
@ -70,4 +72,8 @@ class UserAvatarView extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect()(UserAvatarView);
|
const mapStateToProps = state => ({
|
||||||
|
currentUsername: state.account.currentAccount.name,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps)(UserAvatarView);
|
||||||
|
Loading…
Reference in New Issue
Block a user