From 24c269c9d52ec7cf2cd383a8d7c3aee43ed475c1 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 27 Oct 2020 20:44:36 -0400 Subject: [TMA-180] Image Carousel for Tagg Posts (#77) * image carousel done * fixed a minor bug * TikTok is TikTok NOT Tiktok OKAY? Co-authored-by: Husam Salhab <47015061+hsalhab@users.noreply.github.com> --- src/components/taggs/TaggPost.tsx | 24 ++++++++++++++++++------ src/components/taggs/TwitterTaggPost.tsx | 15 ++++++++++++--- 2 files changed, 30 insertions(+), 9 deletions(-) (limited to 'src/components/taggs') diff --git a/src/components/taggs/TaggPost.tsx b/src/components/taggs/TaggPost.tsx index 07efd797..071dbfc4 100644 --- a/src/components/taggs/TaggPost.tsx +++ b/src/components/taggs/TaggPost.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Image, StyleSheet, Text, View} from 'react-native'; import {SimplePostType} from '../../types'; import {SCREEN_WIDTH} from '../../utils'; -import {DateLabel} from '../common'; +import {DateLabel, PostCarousel} from '../common'; import TaggPostFooter from './TaggPostFooter'; import Hyperlink from 'react-native-hyperlink'; @@ -14,11 +14,18 @@ const TaggPost: React.FC = ({post}) => { // Post with image and footer that shows caption return ( - - {post && ( - - )} - + {post.media_url.length === 1 && post.media_url[0] !== null ? ( + + ) : ( + + )} = ({ )} {/* Second part of content is an image or empty */} - {post.media_url ? ( + {post.media_url.length !== 0 ? ( - + {post.media_url.length === 1 && post.media_url[0] !== null ? ( + + ) : ( + + )} ) : ( @@ -89,6 +97,7 @@ const TwitterTaggPost: React.FC = ({ }> @{post.in_reply_to.handle} + {/* We're not displaying any images here in the container */}