diff options
Diffstat (limited to 'src/components/profile/ProfileBody.tsx')
-rw-r--r-- | src/components/profile/ProfileBody.tsx | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index 85634daa..70f98a4b 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -9,18 +9,18 @@ import {NO_PROFILE} from '../../store/initialStates'; interface ProfileBodyProps { onLayout: (event: LayoutChangeEvent) => void; - isFollowed: boolean; + isFriend: boolean; isBlocked: boolean; - handleFollowUnfollow: Function; - handleBlockUnblock: Function; + handleFriendUnfriend: () => void; + handleBlockUnblock: () => void; userXId: string | undefined; screenType: ScreenType; } const ProfileBody: React.FC<ProfileBodyProps> = ({ onLayout, - isFollowed, + isFriend, isBlocked, - handleFollowUnfollow, + handleFriendUnfriend, handleBlockUnblock, userXId, screenType, @@ -48,21 +48,26 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({ ); }}>{`${website}`}</Text> )} - {userXId && ( + + {userXId && isBlocked && ( <View style={styles.toggleButtonContainer}> - {!isBlocked && ( - <ToggleButton - toggleState={isFollowed} - handleToggle={handleFollowUnfollow} - buttonType={TOGGLE_BUTTON_TYPE.FOLLOW_UNFOLLOW} - /> - )} <ToggleButton toggleState={isBlocked} handleToggle={handleBlockUnblock} buttonType={TOGGLE_BUTTON_TYPE.BLOCK_UNBLOCK} /> </View> + + )} + {userXId && !isBlocked && ( + <View style={styles.toggleButtonContainer}> + <ToggleButton + toggleState={isFriend} + handleToggle={handleFriendUnfriend} + buttonType={TOGGLE_BUTTON_TYPE.FRIEND_UNFRIEND} + /> + </View> + )} </View> ); |