From 5de44211bbadb451b5951eb3f77658d9bab42bc5 Mon Sep 17 00:00:00 2001
From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com>
Date: Mon, 7 Dec 2020 15:27:27 -0800
Subject: [TMA - 431] Make socials browsable (#134)

* Open socials apart from twitter on browser

* Revert "Open socials apart from twitter on browser"

This reverts commit 5b6626811ab7cf9a944b22a1d1d5c4047fe47c64.

* Open socials apart from twitter on browser

* Fixed

* make twitter round

* Make some more placeholders browsable

Co-authored-by: Ivan Chen <ivan@tagg.id>
---
 src/components/taggs/TwitterTaggPost.tsx | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'src/components/taggs/TwitterTaggPost.tsx')

diff --git a/src/components/taggs/TwitterTaggPost.tsx b/src/components/taggs/TwitterTaggPost.tsx
index fb4cbd0f..c971a82c 100644
--- a/src/components/taggs/TwitterTaggPost.tsx
+++ b/src/components/taggs/TwitterTaggPost.tsx
@@ -3,9 +3,13 @@ import {Image, Linking, StyleSheet, View} from 'react-native';
 import {Text} from 'react-native-animatable';
 import Hyperlink from 'react-native-hyperlink';
 import LinearGradient from 'react-native-linear-gradient';
-import {AVATAR_DIM, TAGGS_GRADIENT, TAGG_TEXT_LIGHT_BLUE} from '../../constants';
+import {
+  AVATAR_DIM,
+  TAGGS_GRADIENT,
+  TAGG_TEXT_LIGHT_BLUE,
+} from '../../constants';
 import {TwitterPostType} from '../../types';
-import {SCREEN_WIDTH} from '../../utils';
+import {handleOpenSocialUrlOnBrowser, SCREEN_WIDTH} from '../../utils';
 import {DateLabel, PostCarousel} from '../common';
 
 interface TwitterTaggPostProps {
@@ -16,11 +20,6 @@ const TwitterTaggPost: React.FC<TwitterTaggPostProps> = ({
   ownerHandle,
   post,
 }) => {
-  const openTwitterProfileLink = (handle?: string) => {
-    if (handle) {
-      Linking.openURL(`https://twitter.com/${handle}`);
-    }
-  };
   return (
     <View style={styles.mainContainer}>
       {/* Retweeted? */}
@@ -41,7 +40,7 @@ const TwitterTaggPost: React.FC<TwitterTaggPostProps> = ({
         />
         <Text
           style={styles.headerText}
-          onPress={() => openTwitterProfileLink(post.handle)}>
+          onPress={() => handleOpenSocialUrlOnBrowser(post.handle, 'Twitter')}>
           @{post.handle}
         </Text>
       </View>
-- 
cgit v1.2.3-70-g09d2

