aboutsummaryrefslogtreecommitdiff
path: root/src/components/moments/MomentPost.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-16 15:08:42 -0400
committerIvan Chen <ivan@tagg.id>2021-07-16 15:08:42 -0400
commit5d2703d434d38b633fc8b27b32a4f6dd5fabd1bb (patch)
tree0d2ed06d334797dab9cd5dd93d8483ac94403571 /src/components/moments/MomentPost.tsx
parent3c3a5ab63ce05d9212d222584e23d5a5005c139b (diff)
Add tagged users drawer component
Diffstat (limited to 'src/components/moments/MomentPost.tsx')
-rw-r--r--src/components/moments/MomentPost.tsx22
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