import React, {useState} from 'react'; import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import MoreIcon from '../../assets/icons/more_horiz-24px.svg'; import {TAGG_DARK_BLUE} from '../../constants'; import {AuthContext, ProfileContext} from '../../routes/'; import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; import Avatar from './Avatar'; import MoreInfoDrawer from './MoreInfoDrawer'; import FollowCount from './FollowCount'; type ProfileHeaderProps = { isProfileView: boolean; numFollowing: number; numFollowers: number; }; const ProfileHeader: React.FC = ({ isProfileView, numFollowing, numFollowers, }) => { const { profile: {name}, } = isProfileView ? React.useContext(ProfileContext) : React.useContext(AuthContext); const [drawerVisible, setDrawerVisible] = useState(false); return ( {!isProfileView && ( <> { setDrawerVisible(true); }}> )} {name} ); }; const styles = StyleSheet.create({ container: { top: SCREEN_HEIGHT / 2.4, width: '100%', position: 'absolute', }, row: { flexDirection: 'row', }, header: { justifyContent: 'center', alignItems: 'center', marginTop: SCREEN_HEIGHT / 40, marginLeft: SCREEN_WIDTH / 10, marginBottom: SCREEN_HEIGHT / 50, }, avatar: { bottom: SCREEN_HEIGHT / 80, }, name: { fontSize: 20, fontWeight: '700', marginBottom: SCREEN_HEIGHT / 80, }, follows: { marginHorizontal: SCREEN_HEIGHT / 50, }, more: { position: 'absolute', right: '5%', marginTop: '4%', zIndex: 1, }, }); export default ProfileHeader;