diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-16 15:08:42 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-16 15:08:42 -0400 |
commit | 5d2703d434d38b633fc8b27b32a4f6dd5fabd1bb (patch) | |
tree | 0d2ed06d334797dab9cd5dd93d8483ac94403571 /src/components/moments/TaggedUsersDrawer.tsx | |
parent | 3c3a5ab63ce05d9212d222584e23d5a5005c139b (diff) |
Add tagged users drawer component
Diffstat (limited to 'src/components/moments/TaggedUsersDrawer.tsx')
-rw-r--r-- | src/components/moments/TaggedUsersDrawer.tsx | 112 |
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; |