import React from 'react'; import {StyleSheet, View, Text, LayoutChangeEvent} from 'react-native'; import {TAGG_DARK_BLUE, TOGGLE_BUTTON_TYPE} from '../../constants'; import {AuthContext, ProfileContext} from '../../routes/'; import ToggleButton from './ToggleButton'; interface ProfileBodyProps { onLayout: (event: LayoutChangeEvent) => void; isProfileView: boolean; isFollowed: boolean; isBlocked: boolean; isOwnProfile: boolean; handleFollowUnfollow: Function; handleBlockUnblock: Function; } const ProfileBody: React.FC = ({ onLayout, isProfileView, isFollowed, isBlocked, isOwnProfile, handleFollowUnfollow, handleBlockUnblock, }) => { const { profile, user: {username}, } = isProfileView ? React.useContext(ProfileContext) : React.useContext(AuthContext); const {biography, website} = profile; return ( {`@${username}`} {`${biography}`} {`${website}`} {isProfileView && !isOwnProfile ? ( {!isBlocked && ( )} ) : ( <> )} ); }; const styles = StyleSheet.create({ toggleButtonContainer: { flexDirection: 'row', flex: 1, }, container: { paddingVertical: 5, paddingHorizontal: 20, backgroundColor: 'white', }, username: { fontWeight: '600', fontSize: 16, marginBottom: 5, }, biography: { fontSize: 16, lineHeight: 22, marginBottom: 5, }, website: { fontSize: 16, color: TAGG_DARK_BLUE, marginBottom: 5, }, }); export default ProfileBody;