From a5ef509d2a1f79d85c76ee766dabe96acac2a989 Mon Sep 17 00:00:00 2001 From: George Rusu Date: Tue, 25 May 2021 13:22:52 -0700 Subject: Add layering functionality when editing tags --- src/components/moments/MomentPostContent.tsx | 40 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'src/components/moments') diff --git a/src/components/moments/MomentPostContent.tsx b/src/components/moments/MomentPostContent.tsx index e702cb68..df7f4e68 100644 --- a/src/components/moments/MomentPostContent.tsx +++ b/src/components/moments/MomentPostContent.tsx @@ -1,6 +1,8 @@ import {useNavigation} from '@react-navigation/native'; import React, {useEffect, useRef, useState} from 'react'; import {Image, StyleSheet, Text, View, ViewProps} from 'react-native'; +import {TouchableWithoutFeedback} from 'react-native-gesture-handler'; +import Animated, {Easing} from 'react-native-reanimated'; import {useDispatch, useStore} from 'react-redux'; import {getCommentsCount, loadMomentTags} from '../../services'; import {RootState} from '../../store/rootReducer'; @@ -58,15 +60,36 @@ const MomentPostContent: React.FC = ({ fetchCommentsCount(); }, [dateTime, momentId]); + useEffect(() => { + const fade = async () => { + Animated.timing(fadeValue, { + toValue: 1, + duration: 250, + easing: Easing.linear, + }).start(); + }; + fade(); + }, [fadeValue]); + return ( - - + { + setVisible(!visible); + setFadeValue(new Animated.Value(0)); + }}> + + + {visible && ( + + + + )}