aboutsummaryrefslogtreecommitdiff
path: root/src/components/moments/TaggedUsersDrawer.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-16 21:15:07 -0400
committerGitHub <noreply@github.com>2021-07-16 21:15:07 -0400
commit9766c3b0b4764052d708dba2a20d9673230de9c7 (patch)
tree40703c8d2dd5abf0a24c07ab8932559ebc2f9cd5 /src/components/moments/TaggedUsersDrawer.tsx
parent4ebb552aef8c5f6136c9359c54f2e4e1aa921241 (diff)
parentc1b4e35862172b2268a3a53ece0acc807260652e (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/TaggedUsersDrawer.tsx')
-rw-r--r--src/components/moments/TaggedUsersDrawer.tsx112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/components/moments/TaggedUsersDrawer.tsx b/src/components/moments/TaggedUsersDrawer.tsx
new file mode 100644
index 00000000..86698d30
--- /dev/null
+++ b/src/components/moments/TaggedUsersDrawer.tsx
@@ -0,0 +1,112 @@
+import React from 'react';
+import {
+ ScrollView,
+ StyleSheet,
+ Text,
+ TouchableOpacity,
+ View,
+} from 'react-native';
+import {BottomDrawer, ProfilePreview} from '..';
+import {ProfilePreviewType, ScreenType} from '../../types';
+import {isIPhoneX, normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
+
+interface TaggedUsersDrawerProps {
+ users: ProfilePreviewType[];
+ isOpen: boolean;
+ setIsOpen: (open: boolean) => void;
+}
+const TaggedUsersDrawer: React.FC<TaggedUsersDrawerProps> = ({
+ users,
+ isOpen,
+ setIsOpen,
+}) => {
+ return (
+ <BottomDrawer
+ initialSnapPosition={isIPhoneX() ? '35%' : '40%'}
+ showHeader={false}
+ isOpen={isOpen}
+ setIsOpen={setIsOpen}>
+ <View style={styles.mainContainer}>
+ <View style={styles.headerContainer}>
+ <Text style={styles.title}>Tagged Friends</Text>
+ </View>
+ <View style={styles.scrollViewContainer}>
+ <ScrollView
+ contentContainerStyle={styles.scrollView}
+ horizontal
+ showsHorizontalScrollIndicator={false}>
+ {users.map((profilePreview) => (
+ <ProfilePreview
+ previewType={'Suggested People Drawer'}
+ screenType={ScreenType.SuggestedPeople}
+ profilePreview={profilePreview}
+ setMFDrawer={setIsOpen}
+ />
+ ))}
+ </ScrollView>
+ </View>
+ <TouchableOpacity
+ style={styles.cancelButton}
+ onPress={() => setIsOpen(false)}>
+ <Text style={styles.cancelButtonText}>Cancel</Text>
+ </TouchableOpacity>
+ </View>
+ </BottomDrawer>
+ );
+};
+
+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;