From 9e752233070624c246426ffad422e50448318e57 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 18 Jun 2021 01:15:02 -0700 Subject: Fix bottom tab permanently hidden issue --- src/components/comments/ZoomInCropper.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx index 4e8f9e7c..54acc26e 100644 --- a/src/components/comments/ZoomInCropper.tsx +++ b/src/components/comments/ZoomInCropper.tsx @@ -1,6 +1,7 @@ import {RouteProp} from '@react-navigation/core'; +import {useFocusEffect} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; -import React, {useEffect, useState} from 'react'; +import React, {useCallback, useEffect, useState} from 'react'; import {Dimensions, Image, StyleSheet, TouchableOpacity} from 'react-native'; import {normalize} from 'react-native-elements'; import ImageZoom from 'react-native-image-pan-zoom'; @@ -26,11 +27,18 @@ export const ZoomInCropper: React.FC = ({ const {screenType, title, image} = route.params; const [aspectRatio, setAspectRatio] = useState(1); - useEffect(() => { - navigation.dangerouslyGetParent()?.setOptions({ - tabBarVisible: false, - }); - }, []); + useFocusEffect( + useCallback(() => { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: false, + }); + return () => { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); + }; + }, [navigation]), + ); useEffect(() => { if (image.sourceURL) { -- cgit v1.2.3-70-g09d2 From f6ac1f946f2d673e399e2f9734f533da129b820f Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 18 Jun 2021 01:15:31 -0700 Subject: Fix moment poster preview clickable area --- src/components/moments/MomentPost.tsx | 84 +++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index 8a3cfacb..3840cb08 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -8,6 +8,7 @@ import { StyleSheet, Text, TouchableOpacity, + TouchableWithoutFeedback, View, } from 'react-native'; import Animated, {EasingNode} from 'react-native-reanimated'; @@ -36,6 +37,7 @@ import { import {mentionPartTypes, renderTextWithMentions} from '../../utils/comments'; import {AddComment} from '../comments'; import CommentsCount from '../comments/CommentsCount'; +import {MomentTags} from '../common'; import {MomentMoreInfoDrawer, TaggAvatar} from '../profile'; interface MomentPostProps { moment: MomentPostType; @@ -206,28 +208,36 @@ const MomentPost: React.FC = ({ ); }, [tags]); - const MomentUserPreview = () => ( - - navigateToProfile(state, dispatch, navigation, screenType, user) - } - style={styles.header}> - - {user.username} - + const MomentPosterPreview = () => ( + + + navigateToProfile(state, dispatch, navigation, screenType, user) + } + style={styles.header}> + + {user.username} + + ); const TagsIcon = () => { - return tags.length === 0 ? ( - + return tags.length > 0 ? ( + { + setVisible(!visible); + setFadeValue(new Animated.Value(0)); + }}> + + ) : ( ); @@ -285,6 +295,26 @@ const MomentPost: React.FC = ({ tags={tags} /> + {visible && ( + + null} + imageRef={imageRef} + /> + + )} @@ -302,7 +332,7 @@ const MomentPost: React.FC = ({ }}> - + {!hideText && ( <> {moment.caption !== '' && @@ -354,7 +384,6 @@ const MomentPost: React.FC = ({ const styles = StyleSheet.create({ postHeader: {}, postContent: { - // minHeight: SCREEN_HEIGHT * 0.8, paddingBottom: normalize(20), }, image: { @@ -381,12 +410,6 @@ const styles = StyleSheet.create({ marginBottom: normalize(5), width: SCREEN_WIDTH * 0.79, }, - tapTag: { - position: 'absolute', - backgroundColor: 'red', - width: 100, - height: 100, - }, tagIcon: { width: normalize(30), height: normalize(30), @@ -404,12 +427,17 @@ const styles = StyleSheet.create({ fontWeight: 'bold', color: 'white', paddingHorizontal: '3%', - flex: 1, }, header: { alignItems: 'center', flexDirection: 'row', marginBottom: normalize(15), + alignSelf: 'flex-start', + }, + momentPosterContainer: { + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', }, }); -- cgit v1.2.3-70-g09d2 From ea562eff372995cf8f2cfc389d979452a3885c52 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 18 Jun 2021 01:16:23 -0700 Subject: Edit display style of image in tag friends screen --- src/screens/moments/TagFriendsScreen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx index 570c3776..6956dc0d 100644 --- a/src/screens/moments/TagFriendsScreen.tsx +++ b/src/screens/moments/TagFriendsScreen.tsx @@ -86,7 +86,7 @@ const TagFriendsScreen: React.FC = ({route}) => { ref={imageRef} style={styles.image} source={{uri: imagePath}} - resizeMode={'cover'} + resizeMode={'contain'} /> {tags.length !== 0 && ( -- cgit v1.2.3-70-g09d2