From 9940cfdf9d55fc6bb505e68a315373babad46bae Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Thu, 8 Jul 2021 09:25:34 -0400 Subject: Fixed title --- src/screens/moments/TagFriendsScreen.tsx | 121 ++++++++++++++++++------------- 1 file changed, 71 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx index a0b782bf..6a96a094 100644 --- a/src/screens/moments/TagFriendsScreen.tsx +++ b/src/screens/moments/TagFriendsScreen.tsx @@ -4,6 +4,7 @@ import React, {useCallback, useEffect, useRef, useState} from 'react'; import { Image, StyleSheet, + Text, TouchableOpacity, TouchableWithoutFeedback, View, @@ -13,7 +14,7 @@ import {Button} from 'react-native-elements'; import Video from 'react-native-video'; import {MainStackParams} from 'src/routes'; import BackArrow from '../../assets/icons/back-arrow.svg'; -import {CaptionScreenHeader, MomentTags} from '../../components'; +import {MomentTags} from '../../components'; import {TagFriendsFooter} from '../../components/moments'; import {TAGG_LIGHT_BLUE_2} from '../../constants'; import {MomentTagType} from '../../types'; @@ -80,22 +81,25 @@ const TagFriendsScreen: React.FC = ({route}) => { * Navigate back to Tag Users Screen, send selected users */ const handleDone = () => { - navigation.navigate('CaptionScreen', { - ...route.params, - selectedTags: tags, - }); + // Makes sure that this can only be pressed if there are tags + if (tags.length !== 0) { + navigation.navigate('CaptionScreen', { + ...route.params, + selectedTags: tags, + }); + } }; const setMediaDimensions = (width: number, height: number) => { const imageAspectRatio = width / height; const screenRatio = SCREEN_WIDTH / SCREEN_HEIGHT; - // aspectRatio: >= 1 [Landscape] [1:1] + // aspectRatio is wider than or equal to screen if (imageAspectRatio >= screenRatio) { setImageWidth(SCREEN_WIDTH); setImageHeight(SCREEN_WIDTH / imageAspectRatio); } - // aspectRatio: < 1 [Portrait] + // aspectRatio is taller than screen if (imageAspectRatio < screenRatio) { setImageHeight(SCREEN_HEIGHT); setImageWidth(SCREEN_HEIGHT * imageAspectRatio); @@ -169,39 +173,43 @@ const TagFriendsScreen: React.FC = ({route}) => { )} - { - navigation.goBack(); - }} - style={styles.backArrow}> - - - - - {tags.length !== 0 && ( - -