Closed aliraza96 closed 2 years ago
The Detailed Code is given Below
`
<ClickableText
onPress={() => {
console.log('Delete');
petOptionsActionSheet.current.hide();
firestore().collection('allPets').doc(data.petId).delete();
navigation.goBack();
}}
textToPut={'Delete'}
textStyle={{
margin: 8,
marginTop: 16,
alignSelf: 'center',
color: colors.blue,
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
<ClickableText
onPress={() => {
petOptionsActionSheet.current.setModalVisible();
}}
textToPut={'Cancel'}
textStyle={{
margin: 8,
marginTop: 25,
alignSelf: 'center',
color: colors.danger,
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
</View>
<ActionSheet ref={photoOrVideoActionSheet} bounceOnOpen={true}>
<View
style={{
flexDirection: 'column',
margin: 20,
marginBottom: 30,
}}>
<ClickableText
onPress={() => {
console.log('PhotoSelected');
photoOrVideoSelected = 'photo';
cameraOrGalleryActionSheet.current.setModalVisible();
}}
textToPut={'Photo'}
textStyle={{
margin: 8,
color: colors.blue,
alignSelf: 'center',
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
<ClickableText
onPress={() => {
console.log('VideoSelected');
photoOrVideoSelected = 'video';
cameraOrGalleryActionSheet.current.setModalVisible();
}}
textToPut={'Video'}
textStyle={{
margin: 8,
marginTop: 16,
alignSelf: 'center',
color: colors.blue,
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
<ClickableText
onPress={() => {
photoOrVideoActionSheet.current.setModalVisible();
}}
textToPut={'Cancel'}
textStyle={{
margin: 8,
marginTop: 25,
alignSelf: 'center',
color: colors.danger,
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
</View>
<ActionSheet ref={cameraOrGalleryActionSheet} bounceOnOpen={true}>
<View
style={{
flexDirection: 'column',
margin: 20,
marginBottom: 30,
}}>
<ClickableText
onPress={() => {
console.log('Camera');
pickImageOrVideo(
'camera',
photoOrVideoSelected,
returnUri => {
console.log('URI:: ' + returnUri);
if (photoOrVideoSelected === 'photo') {
uploadPhoto(returnUri);
} else if (photoOrVideoSelected === 'video') {
uploadVideo(returnUri);
}
petOptionsActionSheet.current?.hide();
},
);
//var uri = cameraOrGallery('camera');
// try {
// petOptionsActionSheet.current.setModalVisible();
// // cameraOrGalleryActionSheet.current.setModalVisible();
// // photoOrVideoActionSheet.current.setModalVisible();
// } catch (error) {}
}}
textToPut={'Camera'}
textStyle={{
margin: 8,
color: colors.blue,
alignSelf: 'center',
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
<ClickableText
onPress={() => {
console.log('Gallery');
pickImageOrVideo(
'gallery',
photoOrVideoSelected,
returnUri => {
console.log('URI:: ' + returnUri);
if (photoOrVideoSelected === 'photo') {
uploadPhoto(returnUri);
} else if (photoOrVideoSelected === 'video') {
uploadVideo(returnUri);
}
petOptionsActionSheet.current.hide();
},
);
}}
textToPut={'Gallery'}
textStyle={{
margin: 8,
marginTop: 16,
alignSelf: 'center',
color: colors.blue,
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
<ClickableText
onPress={() => {
cameraOrGalleryActionSheet.current.setModalVisible();
}}
textToPut={'Cancel'}
textStyle={{
margin: 8,
marginTop: 25,
alignSelf: 'center',
color: colors.danger,
fontSize: 20,
fontFamily: 'ProductSans-Medium',
}}
/>
</View>
</ActionSheet>
</ActionSheet>
</ActionSheet>`
Whenever I try to hide the action sheet, this happens.![Simulator Screen Shot - iPhone 13 - 2021-12-21 at 15 57 38](https://user-images.githubusercontent.com/59387704/146919164-d4718771-4673-4a77-a187-c8736a035c39.png)