diff options
Diffstat (limited to 'src/components/taggs')
-rw-r--r-- | src/components/taggs/Tagg.tsx | 12 | ||||
-rw-r--r-- | src/components/taggs/TaggsBar.tsx | 3 |
2 files changed, 13 insertions, 2 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) => { diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx index f2622011..aac68e99 100644 --- a/src/components/taggs/TaggsBar.tsx +++ b/src/components/taggs/TaggsBar.tsx @@ -79,7 +79,8 @@ const TaggsBar: React.FC<TaggsBarProps> = ({ * TODO : Figure out a better way to get the updates social posts for the profile being visited. * Have an event triggered from ProfileProvider based on which we could make a call to backedn to get updated posts. */ - socialsNeedUpdate(INTEGRATED_SOCIAL_LIST); + //We may need the line below in future ? + // socialsNeedUpdate(INTEGRATED_SOCIAL_LIST); loadData(); } }, [isProfileView, taggsNeedUpdate, user.userId]); |