From 97b7c29fe22f0d31a1a6b095de0ea76a3067e115 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 27 Jul 2021 15:15:46 -0400 Subject: Clean up styling in tagg friends screen --- src/screens/moments/TagFriendsScreen.tsx | 85 +++++++++++++------------------- 1 file changed, 34 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx index d11f8049..677ceefa 100644 --- a/src/screens/moments/TagFriendsScreen.tsx +++ b/src/screens/moments/TagFriendsScreen.tsx @@ -10,15 +10,13 @@ import { View, } from 'react-native'; import Video from 'react-native-video'; -import {MainStackParams} from 'src/routes'; -import BackArrow from '../../assets/icons/back-arrow.svg'; import {MomentTags} from '../../components'; import {TagFriendsFooter} from '../../components/moments'; +import {headerBarOptions, MainStackParams} from '../../routes'; import {MomentTagType} from '../../types'; import { HeaderHeight, isIPhoneX, - normalize, SCREEN_HEIGHT, SCREEN_WIDTH, } from '../../utils'; @@ -48,6 +46,36 @@ const TagFriendsScreen: React.FC = ({route}) => { setTags(selectedTags ? selectedTags : []); }, [selectedTags]); + useEffect(() => { + const title = media.isVideo + ? '' + : tags.length === 0 + ? 'Tap on photo to tag friends!' + : 'Press and drag to move'; + navigation.setOptions({ + ...headerBarOptions('white', title), + headerRight: () => ( + + + Done + + + ), + }); + }, [tags]); + /* * Navigate back to Tag Users Screen, send selected users */ @@ -174,49 +202,8 @@ const TagFriendsScreen: React.FC = ({route}) => { onLayout={(event) => { const {y, height} = event.nativeEvent.layout; setTopHeight(y + height); - }}> - { - navigation.goBack(); - }} - style={styles.backArrow}> - - - - - {!media.isVideo ? ( - - {tags.length === 0 ? ( - Tap on photo to tag friends! - ) : ( - Press and drag to move - )} - - ) : ( - - )} - - - Done - - - + }} + /> {tags.length !== 0 && !media.isVideo && (