diff options
Diffstat (limited to 'src/components/profile/ProfileBody.tsx')
-rw-r--r-- | src/components/profile/ProfileBody.tsx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index 53b86708..7091a077 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -1,24 +1,44 @@ import React from 'react'; import {StyleSheet, View, Text, LayoutChangeEvent} from 'react-native'; import {AuthContext, ProfileContext} from '../../routes/'; +import FollowUnfollow from './FollowUnfollow'; interface ProfileBodyProps { onLayout: (event: LayoutChangeEvent) => void; isProfileView: boolean; + followed: boolean; + isOwnProfile: boolean; + handleFollowUnfollow: Function; } -const ProfileBody: React.FC<ProfileBodyProps> = ({onLayout, isProfileView}) => { +const ProfileBody: React.FC<ProfileBodyProps> = ({ + onLayout, + isProfileView, + followed, + isOwnProfile, + handleFollowUnfollow, +}) => { const { profile, user: {username}, } = isProfileView ? React.useContext(ProfileContext) : React.useContext(AuthContext); + const {biography, website} = profile; + return ( <View onLayout={onLayout} style={styles.container}> <Text style={styles.username}>{`@${username}`}</Text> <Text style={styles.biography}>{`${biography}`}</Text> <Text style={styles.website}>{`${website}`}</Text> + {isProfileView && !isOwnProfile ? ( + <FollowUnfollow + followed={followed} + handleFollowUnfollow={handleFollowUnfollow} + /> + ) : ( + <></> + )} </View> ); }; |