diff options
Diffstat (limited to 'src/components/taggs')
-rw-r--r-- | src/components/taggs/Tagg.tsx | 14 | ||||
-rw-r--r-- | src/components/taggs/TaggsBar.tsx | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/components/taggs/Tagg.tsx b/src/components/taggs/Tagg.tsx index 39cbee06..a9bc05a9 100644 --- a/src/components/taggs/Tagg.tsx +++ b/src/components/taggs/Tagg.tsx @@ -7,6 +7,7 @@ import RingPlus from '../../assets/icons/ring+.svg'; import Ring from '../../assets/icons/ring.svg'; import {INTEGRATED_SOCIAL_LIST, TAGG_ICON_DIM} from '../../constants'; import { + getNonIntegratedURL, handlePressForAuthBrowser, registerNonIntegratedSocialLink, } from '../../services'; @@ -19,6 +20,7 @@ interface TaggProps { isIntegrated: boolean; setTaggsNeedUpdate: (_: boolean) => void; setSocialDataNeedUpdate: (_: string[]) => void; + userId: string; } const Tagg: React.FC<TaggProps> = ({ @@ -28,6 +30,7 @@ const Tagg: React.FC<TaggProps> = ({ isIntegrated, setTaggsNeedUpdate, setSocialDataNeedUpdate, + userId, }) => { const navigation = useNavigation(); const [modalVisible, setModalVisible] = useState(false); @@ -59,10 +62,13 @@ const Tagg: React.FC<TaggProps> = ({ isProfileView: isProfileView, }); } else { - // TODO: we don't know what the link is...? - Linking.openURL( - `http://google.com/search?q=take+me+to+${social}+profile+page`, - ); + getNonIntegratedURL(social, userId).then((socialURL) => { + if (socialURL) { + Linking.openURL(socialURL); + } else { + Alert.alert('We were unable to find this profile 😔'); + } + }); } } else { if (isIntegrated) { diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx index 520cc266..62f5f90e 100644 --- a/src/components/taggs/TaggsBar.tsx +++ b/src/components/taggs/TaggsBar.tsx @@ -48,6 +48,7 @@ const TaggsBar: React.FC<TaggsBarProps> = ({ isIntegrated={INTEGRATED_SOCIAL_LIST.indexOf(social) !== -1} setTaggsNeedUpdate={setTaggsNeedUpdate} setSocialDataNeedUpdate={socialsNeedUpdate} + userId={user.userId} />, ); i++; @@ -62,6 +63,7 @@ const TaggsBar: React.FC<TaggsBarProps> = ({ isIntegrated={INTEGRATED_SOCIAL_LIST.indexOf(social) !== -1} setTaggsNeedUpdate={setTaggsNeedUpdate} setSocialDataNeedUpdate={socialsNeedUpdate} + userId={user.userId} />, ); i++; |