diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-16 21:15:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 21:15:07 -0400 |
commit | 9766c3b0b4764052d708dba2a20d9673230de9c7 (patch) | |
tree | 40703c8d2dd5abf0a24c07ab8932559ebc2f9cd5 /src/components/moments/MomentPost.tsx | |
parent | 4ebb552aef8c5f6136c9359c54f2e4e1aa921241 (diff) | |
parent | c1b4e35862172b2268a3a53ece0acc807260652e (diff) |
Merge pull request #514 from IvanIFChen/tma988-remove-positioned-tags-for-video-moments
[TMA-988] Remove Positioned Tags for Video Moments
Diffstat (limited to 'src/components/moments/MomentPost.tsx')
-rw-r--r-- | src/components/moments/MomentPost.tsx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index e789a9bf..5dba5e69 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -15,6 +15,7 @@ import { import Animated, {EasingNode} from 'react-native-reanimated'; import Video from 'react-native-video'; import {useDispatch, useSelector, useStore} from 'react-redux'; +import {TaggedUsersDrawer} from '.'; import {headerBarOptions} from '../../routes'; import {MomentContext} from '../../screens/profile/IndividualMoment'; import {deleteMomentTag, loadMomentTags} from '../../services'; @@ -61,6 +62,7 @@ const MomentPost: React.FC<MomentPostProps> = ({ const [tags, setTags] = useState<MomentTagType[]>([]); const [visible, setVisible] = useState(false); const [drawerVisible, setDrawerVisible] = useState(false); + const [taggedUsersVisible, setTaggedUsersVisible] = useState(false); const [hideText, setHideText] = useState(false); const [fadeValue, setFadeValue] = useState<Animated.Value<number>>( @@ -199,6 +201,11 @@ const MomentPost: React.FC<MomentPostProps> = ({ return ( <> <StatusBar barStyle={'light-content'} /> + <TaggedUsersDrawer + users={tags.map((tag) => tag.user)} + isOpen={taggedUsersVisible} + setIsOpen={setTaggedUsersVisible} + /> <View style={styles.mainContainer}> <View style={styles.imageContainer}> {isVideo ? ( @@ -249,6 +256,7 @@ const MomentPost: React.FC<MomentPostProps> = ({ </Animated.View> )} <TouchableWithoutFeedback + disabled={isVideo} onPress={() => { setVisible(!visible); setFadeValue(new Animated.Value(0)); @@ -276,10 +284,16 @@ const MomentPost: React.FC<MomentPostProps> = ({ keyboardVerticalOffset={-20}> <View style={styles.bottomContainer}> {tags.length > 0 && ( - <Image - source={require('../../assets/icons/tag_indicate.png')} - style={styles.tagIcon} - /> + <TouchableOpacity + disabled={!isVideo} + onPress={() => + setTaggedUsersVisible((prevState) => !prevState) + }> + <Image + source={require('../../assets/icons/tag_indicate.png')} + style={styles.tagIcon} + /> + </TouchableOpacity> )} <View style={styles.commentsCountContainer}> <CommentsCount |