diff options
author | Ivan Chen <ivan@thetaggid.com> | 2020-11-04 11:15:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 11:15:44 -0500 |
commit | 95f00471cec3198b8a68fd42206b3781b573cc84 (patch) | |
tree | 03bbc2698dc004ec4535d81c947fb137ae6e5b22 | |
parent | 4d3e0f8f1a2e644af947fb6ada98f7c6a1e0c1f8 (diff) |
not show things if gets deleted (#104)
-rw-r--r-- | src/components/taggs/TwitterTaggPost.tsx | 99 |
1 files changed, 52 insertions, 47 deletions
diff --git a/src/components/taggs/TwitterTaggPost.tsx b/src/components/taggs/TwitterTaggPost.tsx index 2b064610..158b5995 100644 --- a/src/components/taggs/TwitterTaggPost.tsx +++ b/src/components/taggs/TwitterTaggPost.tsx @@ -73,54 +73,58 @@ const TwitterTaggPost: React.FC<TwitterTaggPostProps> = ({ )} {/* Third part of content is the reply/retweet container or empty */} {(post.type === 'reply' || post.type === 'retweet') && - post.in_reply_to ? ( - <LinearGradient - colors={[TAGGS_GRADIENT.start, TAGGS_GRADIENT.end]} - useAngle={true} - angle={300} - angleCenter={{x: 0.5, y: 0.5}} - style={[styles.replyGradient]}> - <View style={styles.replyPostContainer}> - <View style={styles.replyHeader}> - <Image - style={styles.replyAvatar} - source={ - post.in_reply_to.profile_pic - ? {uri: post.in_reply_to.profile_pic} - : require('../../assets/images/avatar-placeholder.png') - } - /> - <Text - style={styles.replyHandleText} - onPress={() => - openTwitterProfileLink(post.in_reply_to?.handle) - }> - @{post.in_reply_to.handle} + post.in_reply_to && ( + <LinearGradient + colors={[TAGGS_GRADIENT.start, TAGGS_GRADIENT.end]} + useAngle={true} + angle={300} + angleCenter={{x: 0.5, y: 0.5}} + style={[styles.replyGradient]}> + <View style={styles.replyPostContainer}> + <View style={styles.replyHeader}> + {post.in_reply_to.text !== 'This tweet is unavailable' && ( + <> + <Image + style={styles.replyAvatar} + source={ + post.in_reply_to.profile_pic + ? {uri: post.in_reply_to.profile_pic} + : require('../../assets/images/avatar-placeholder.png') + } + /> + <Text + style={styles.replyHandleText} + onPress={() => + openTwitterProfileLink(post.in_reply_to?.handle) + }> + @{post.in_reply_to.handle} + </Text> + {/* We're not displaying any images here in the container */} + <DateLabel + timestamp={post.in_reply_to.timestamp} + type={'short'} + decorate={(date) => ` • ${date}`} + /> + </> + )} + </View> + <Text style={styles.replyText} numberOfLines={2}> + {post.in_reply_to.text} </Text> - {/* We're not displaying any images here in the container */} - <DateLabel - timestamp={post.in_reply_to.timestamp} - type={'short'} - decorate={(date) => ` • ${date}`} - /> + {post.in_reply_to.permalink && ( + <Text + style={styles.replyShowThisThread} + onPress={() => { + if (post.in_reply_to?.permalink) { + Linking.openURL(post.in_reply_to?.permalink || ''); + } + }}> + Show this thread + </Text> + )} </View> - <Text style={styles.replyText} numberOfLines={2}> - {post.in_reply_to.text} - </Text> - <Text - style={styles.replyShowThisThread} - onPress={() => { - if (post.in_reply_to?.permalink) { - Linking.openURL(post.in_reply_to?.permalink || ''); - } - }}> - Show this thread - </Text> - </View> - </LinearGradient> - ) : ( - <React.Fragment /> - )} + </LinearGradient> + )} </View> {/* Footer */} <View style={styles.footer}> @@ -207,7 +211,7 @@ const styles = StyleSheet.create({ backgroundColor: '#1d0034', }, replyGradient: { - height: 150, + // height: 150, borderRadius: 15, justifyContent: 'center', alignItems: 'center', @@ -229,6 +233,7 @@ const styles = StyleSheet.create({ }, replyText: { fontSize: 15, + marginVertical: 20, color: 'white', }, replyShowThisThread: { |