aboutsummaryrefslogtreecommitdiff
path: root/src/components/taggs/TaggPostFooter.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-07 15:27:27 -0800
committerGitHub <noreply@github.com>2020-12-07 18:27:27 -0500
commit5de44211bbadb451b5951eb3f77658d9bab42bc5 (patch)
tree367392891ec880fc24b58d56eb00d70cd95d15b6 /src/components/taggs/TaggPostFooter.tsx
parent6d1dedb676ff42d18b4e4892ae0c62e76cd1a6c4 (diff)
[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>
Diffstat (limited to 'src/components/taggs/TaggPostFooter.tsx')
-rw-r--r--src/components/taggs/TaggPostFooter.tsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/taggs/TaggPostFooter.tsx b/src/components/taggs/TaggPostFooter.tsx
index 8371a847..ae9d889d 100644
--- a/src/components/taggs/TaggPostFooter.tsx
+++ b/src/components/taggs/TaggPostFooter.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import {StyleSheet, View} from 'react-native';
+import {Linking, StyleSheet, View} from 'react-native';
import {Text} from 'react-native-animatable';
+import {handleOpenSocialUrlOnBrowser} from '../../utils';
import {DateLabel} from '../common';
interface TaggPostFooterProps {
@@ -8,12 +9,14 @@ interface TaggPostFooterProps {
handle?: string;
caption: string;
timestamp: string;
+ social: string;
}
const TaggPostFooter: React.FC<TaggPostFooterProps> = ({
likes,
handle,
caption,
timestamp,
+ social,
}) => {
const handleText = handle ? handle : '';
return (
@@ -21,7 +24,9 @@ const TaggPostFooter: React.FC<TaggPostFooterProps> = ({
<View style={styles.container}>
{likes ? <Text style={styles.likeText}>{likes} likes</Text> : <></>}
<View style={styles.captionContainer}>
- <Text style={styles.handleText}>
+ <Text
+ style={styles.handleText}
+ onPress={() => handleOpenSocialUrlOnBrowser(handleText, social)}>
{handleText}
<Text style={styles.captionText}> {caption}</Text>
</Text>