diff --git a/src/components/profile/profileView.js b/src/components/profile/profileView.js index e5f3672fe..676bc1ae5 100644 --- a/src/components/profile/profileView.js +++ b/src/components/profile/profileView.js @@ -242,14 +242,14 @@ class ProfileView extends PureComponent { } render() { - const { handleOnBackPress, isOwnProfile, quickProfile } = this.props; + const { handleOnBackPress, isOwnProfile, quickProfile, reverseHeader } = this.props; return (
diff --git a/src/containers/profileContainer.js b/src/containers/profileContainer.js index 2e306f7df..4d912702f 100644 --- a/src/containers/profileContainer.js +++ b/src/containers/profileContainer.js @@ -33,6 +33,13 @@ class ProfileContainer extends Component { constructor(props) { super(props); + //check if is signed in user profile + const username = props.navigation.getParam('username'); + const { + currentAccount: { name: currentAccountUsername }, + } = props; + const isOwnProfile = !username || currentAccountUsername === username; + this.state = { comments: [], follows: {}, @@ -42,12 +49,13 @@ class ProfileContainer extends Component { isMuted: false, isProfileLoading: false, isReady: false, - isOwnProfile: !has(props, 'navigation.state.params.username'), + isOwnProfile, user: null, quickProfile: { reputation: get(props, 'navigation.state.params.reputation', ''), name: get(props, 'navigation.state.params.username', ''), }, + reverseHeader: !!username, }; } @@ -427,6 +435,7 @@ class ProfileContainer extends Component { quickProfile, user, username, + reverseHeader, } = this.state; const { currency, isDarkTheme, isLoggedIn, navigation, children, isHideImage } = this.props; const activePage = get(navigation.state.params, 'state', 0); @@ -476,6 +485,7 @@ class ProfileContainer extends Component { quickProfile, selectedUser: user, username, + reverseHeader, }) ); } diff --git a/src/screens/profile/screen/profileScreen.js b/src/screens/profile/screen/profileScreen.js index 6b3b1b79b..bcf8d6e8c 100644 --- a/src/screens/profile/screen/profileScreen.js +++ b/src/screens/profile/screen/profileScreen.js @@ -39,6 +39,7 @@ const ProfileScreen = () => ( setEstimatedWalletValue, username, votingPower, + reverseHeader, }) => ( ( username={username} votingPower={votingPower} isHideImage={isHideImage} + reverseHeader={reverseHeader} /> )}