aboutsummaryrefslogtreecommitdiff
path: root/src/components/taggs/Tagg.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-11-09 12:16:44 -0800
committerGitHub <noreply@github.com>2020-11-09 15:16:44 -0500
commitf347ef180ece9235380f2225243beddaececa949 (patch)
tree02ae7739ae16f68fb47a574420c1c497fb5f06ac /src/components/taggs/Tagg.tsx
parentd7ed9541f47c22d93c43a32baf3bf33d68d823c8 (diff)
[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 <ivan@thetaggid.com>
Diffstat (limited to 'src/components/taggs/Tagg.tsx')
-rw-r--r--src/components/taggs/Tagg.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/taggs/Tagg.tsx b/src/components/taggs/Tagg.tsx
index 9418405d..d9c35b27 100644
--- a/src/components/taggs/Tagg.tsx
+++ b/src/components/taggs/Tagg.tsx
@@ -1,5 +1,5 @@
import {useNavigation} from '@react-navigation/native';
-import React, {Fragment, useState} from 'react';
+import React, {Fragment, useContext, useState} from 'react';
import {Alert, Linking, StyleSheet, TouchableOpacity, View} from 'react-native';
import PurpleRingPlus from '../../assets/icons/purple_ring+.svg';
import PurpleRing from '../../assets/icons/purple_ring.svg';
@@ -16,6 +16,7 @@ import {
registerNonIntegratedSocialLink,
} from '../../services';
import {SocialIcon, SocialLinkModal} from '../common';
+import {AuthContext, ProfileContext} from '../../routes';
interface TaggProps {
social: string;
@@ -39,6 +40,11 @@ const Tagg: React.FC<TaggProps> = ({
const navigation = useNavigation();
const [modalVisible, setModalVisible] = useState(false);
const youMayPass = isLinked || isProfileView;
+ const {
+ profile: {name},
+ socialAccounts,
+ avatar,
+ } = isProfileView ? useContext(ProfileContext) : useContext(AuthContext);
/*
case isProfileView:
@@ -64,6 +70,10 @@ const Tagg: React.FC<TaggProps> = ({
navigation.push('SocialMediaTaggs', {
socialMediaType: social,
isProfileView: isProfileView,
+ userId: userId,
+ name: name,
+ accountData: socialAccounts[social],
+ avatar: avatar,
});
} else {
getNonIntegratedURL(social, userId).then((socialURL) => {