From f347ef180ece9235380f2225243beddaececa949 Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Mon, 9 Nov 2020 12:16:44 -0800 Subject: [FOR MASS REVIEW] Multiple contexts(Searched user gets replaced) (#97) * First commit towards clean code * Tested things * Some final touch * View updates posts * Cleaned up followers / following * You won't believe but it works * Pass avatar uri via props * Small change * Small change * Removed unnecessary jargon Co-authored-by: Ivan Chen --- src/components/common/AvatarTitle.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/components/common') diff --git a/src/components/common/AvatarTitle.tsx b/src/components/common/AvatarTitle.tsx index f3105f70..65ae7486 100644 --- a/src/components/common/AvatarTitle.tsx +++ b/src/components/common/AvatarTitle.tsx @@ -3,15 +3,13 @@ import {Image, StyleSheet, View} from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import {TAGGS_GRADIENT} from '../../constants'; import {AuthContext, ProfileContext} from '../../routes/'; +import {loadAvatar} from '../../services'; +import AsyncStorage from '@react-native-community/async-storage'; type AvatarTitleProps = { - isProfileView: boolean; + avatar: string; }; - -const AvatarTitle: React.FC = ({isProfileView}) => { - const {avatar} = isProfileView - ? React.useContext(ProfileContext) - : React.useContext(AuthContext); +const AvatarTitle: React.FC = ({avatar}) => { return (