diff options
Diffstat (limited to 'src/components/profile/Moment.tsx')
-rw-r--r-- | src/components/profile/Moment.tsx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/components/profile/Moment.tsx b/src/components/profile/Moment.tsx index 0fbabe8f..6ae8d38e 100644 --- a/src/components/profile/Moment.tsx +++ b/src/components/profile/Moment.tsx @@ -1,6 +1,6 @@ import {useNavigation} from '@react-navigation/native'; import React from 'react'; -import {Alert, StyleSheet, View} from 'react-native'; +import {StyleSheet, View} from 'react-native'; import {Text} from 'react-native-animatable'; import {ScrollView, TouchableOpacity} from 'react-native-gesture-handler'; import LinearGradient from 'react-native-linear-gradient'; @@ -8,6 +8,7 @@ import PlusIcon from '../../assets/icons/plus_icon-01.svg'; import BigPlusIcon from '../../assets/icons/plus_icon-02.svg'; import {MOMENTS_TITLE_COLOR} from '../../constants'; import {SCREEN_WIDTH} from '../../utils'; +import ImagePicker from 'react-native-image-crop-picker'; interface MomentProps { title: string; @@ -16,9 +17,21 @@ interface MomentProps { const Moment: React.FC<MomentProps> = ({title, images}) => { const navigation = useNavigation(); + const navigateToImagePicker = () => { - Alert.alert('Perform navigation to Image Picker with Caption screen'); - // navigation.navigate('') + ImagePicker.openPicker({ + width: 580, + height: 580, + cropping: true, + cropperToolbarTitle: 'Upload a moment', + mediaType: 'photo', + }) + .then((picture) => { + if ('path' in picture) { + navigation.navigate('CaptionScreen', {title: title, image: picture}); + } + }) + .catch(() => {}); }; return ( <View style={styles.container}> |