From 3c3a5ab63ce05d9212d222584e23d5a5005c139b Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 16 Jul 2021 14:43:52 -0400 Subject: Hide tags during upload --- src/screens/moments/TagFriendsScreen.tsx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx index fc3bccf2..d11f8049 100644 --- a/src/screens/moments/TagFriendsScreen.tsx +++ b/src/screens/moments/TagFriendsScreen.tsx @@ -188,13 +188,17 @@ const TagFriendsScreen: React.FC = ({route}) => { /> - - {tags.length === 0 ? ( - Tap on photo to tag friends! - ) : ( - Press and drag to move - )} - + {!media.isVideo ? ( + + {tags.length === 0 ? ( + Tap on photo to tag friends! + ) : ( + Press and drag to move + )} + + ) : ( + + )} = ({route}) => { - {tags.length !== 0 && ( + {tags.length !== 0 && !media.isVideo && ( Date: Fri, 16 Jul 2021 15:08:42 -0400 Subject: Add tagged users drawer component --- src/components/moments/MomentPost.tsx | 22 +++++- src/components/moments/TaggedUsersDrawer.tsx | 112 +++++++++++++++++++++++++++ src/components/moments/index.ts | 1 + 3 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 src/components/moments/TaggedUsersDrawer.tsx (limited to 'src') 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 = ({ const [tags, setTags] = useState([]); const [visible, setVisible] = useState(false); const [drawerVisible, setDrawerVisible] = useState(false); + const [taggedUsersVisible, setTaggedUsersVisible] = useState(false); const [hideText, setHideText] = useState(false); const [fadeValue, setFadeValue] = useState>( @@ -199,6 +201,11 @@ const MomentPost: React.FC = ({ return ( <> + tag.user)} + isOpen={taggedUsersVisible} + setIsOpen={setTaggedUsersVisible} + /> {isVideo ? ( @@ -249,6 +256,7 @@ const MomentPost: React.FC = ({ )} { setVisible(!visible); setFadeValue(new Animated.Value(0)); @@ -276,10 +284,16 @@ const MomentPost: React.FC = ({ keyboardVerticalOffset={-20}> {tags.length > 0 && ( - + + setTaggedUsersVisible((prevState) => !prevState) + }> + + )} void; +} +const TaggedUsersDrawer: React.FC = ({ + users, + isOpen, + setIsOpen, +}) => { + return ( + + + + Tagged Friends + + + + {users.map((profilePreview) => ( + + ))} + + + setIsOpen(false)}> + Cancel + + + + ); +}; + +const styles = StyleSheet.create({ + mainContainer: { + flexDirection: 'column', + backgroundColor: '#f9f9f9', + width: SCREEN_WIDTH, + height: SCREEN_HEIGHT * 0.46, + borderTopRightRadius: normalize(13), + borderTopLeftRadius: normalize(13), + borderWidth: 0.5, + borderColor: '#fff', + }, + headerContainer: { + alignItems: 'center', + justifyContent: 'center', + paddingVertical: normalize(17), + shadowOffset: {width: 0, height: 2}, + shadowRadius: 3, + shadowColor: '#000', + shadowOpacity: 0.15, + backgroundColor: '#fff', + borderTopRightRadius: normalize(13), + borderTopLeftRadius: normalize(13), + }, + title: { + fontSize: normalize(18), + lineHeight: 20, + fontWeight: 'bold', + }, + scrollViewContainer: { + height: isIPhoneX() ? 153 : 135, + shadowColor: 'rgb(125, 125, 125)', + marginTop: '1%', + }, + scrollView: { + height: '95%', + padding: 0, + marginHorizontal: '5%', + }, + cancelButton: { + backgroundColor: '#F0F0F0', + height: 100, + flexDirection: 'row', + justifyContent: 'center', + }, + cancelButtonText: { + top: isIPhoneX() ? '6%' : '7%', + color: '#698DD3', + fontSize: normalize(16), + fontWeight: '700', + lineHeight: normalize(20), + letterSpacing: normalize(0.1), + }, +}); + +export default TaggedUsersDrawer; diff --git a/src/components/moments/index.ts b/src/components/moments/index.ts index cac2da2e..2cc4c9dd 100644 --- a/src/components/moments/index.ts +++ b/src/components/moments/index.ts @@ -3,3 +3,4 @@ export {default as CaptionScreenHeader} from './CaptionScreenHeader'; export {default as Moment} from './Moment'; export {default as TagFriendsFooter} from './TagFriendsFoooter'; export {default as MomentPost} from './MomentPost'; +export {default as TaggedUsersDrawer} from './TaggedUsersDrawer'; -- cgit v1.2.3-70-g09d2 From c22c19c9eeb28641d36cb9df38fe95301e0f768c Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 16 Jul 2021 15:11:35 -0400 Subject: Change positions to 0 if video --- src/screens/profile/CaptionScreen.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 6bcf0e24..d07743ad 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -153,9 +153,9 @@ const CaptionScreen: React.FC = ({route, navigation}) => { const formattedTags = () => { return tags.map((tag) => ({ - x: tag.x, - y: tag.y, - z: tag.z, + x: isMediaAVideo ? 0 : tag.x, + y: isMediaAVideo ? 0 : tag.y, + z: isMediaAVideo ? 0 : tag.z, user_id: tag.user.id, })); }; -- cgit v1.2.3-70-g09d2