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