From 63b37274815ed2a4e3b66e44f1a329c4ce4dd28b Mon Sep 17 00:00:00 2001 From: natjms Date: Wed, 24 Mar 2021 11:49:08 -0300 Subject: [PATCH] Fix rendering inconsistencies between one's own and someone else's profile --- src/components/pages/profile.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/components/pages/profile.js b/src/components/pages/profile.js index c8f761c..568ca50 100644 --- a/src/components/pages/profile.js +++ b/src/components/pages/profile.js @@ -144,7 +144,6 @@ const ProfileDisplayJsx = ({navigation}) => { const accountName = navigation.getParam("acct", ""); let [state, setState] = useState({ loaded: false, - own: false }); const notif_pack = { @@ -157,7 +156,8 @@ const ProfileDisplayJsx = ({navigation}) => { setState({ profile: TEST_PROFILE, mutuals: getMutuals(TEST_YOUR_FOLLOWERS, TEST_THEIR_FOLLOWERS), - loaded: true + own: true, + loaded: true, }); }, []); @@ -200,16 +200,13 @@ const ProfileDisplayJsx = ({navigation}) => { { state.own ? - - - + + + + + : @@ -220,13 +217,21 @@ const ProfileDisplayJsx = ({navigation}) => { { + const context = state.own ? + "People following you" + : "Your mutual followers with " + state.profile.display_name; navigation.navigate("UserList", { data: [/*Some array of users*/], - context: "Your mutual followers with " + state.profile.display_name + context: context }); } }> - { state.mutuals.length } mutuals + { + state.own ? + "View followers" + :state.mutuals.length + " mutuals" + } +