From a8c210165938cfa4da7ed6bc185af297d528d2aa Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 30 Jun 2021 15:32:52 -0400 Subject: Remove filename requirement for all moment upload --- src/components/comments/ZoomInCropper.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/components/comments') diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx index cfd3cbbc..7fa88f6e 100644 --- a/src/components/comments/ZoomInCropper.tsx +++ b/src/components/comments/ZoomInCropper.tsx @@ -1,6 +1,7 @@ import {RouteProp} from '@react-navigation/core'; +import {useFocusEffect} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; -import React, {useEffect, useState} from 'react'; +import React, {useCallback, useEffect, useState} from 'react'; import {Image, StyleSheet, TouchableOpacity} from 'react-native'; import {normalize} from 'react-native-elements'; import ImageZoom, {IOnMove} from 'react-native-image-pan-zoom'; @@ -33,6 +34,19 @@ export const ZoomInCropper: React.FC = ({ const [y0, setY0] = useState(); const [y1, setY1] = useState(); + useFocusEffect( + useCallback(() => { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: false, + }); + return () => { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); + }; + }, [navigation]), + ); + // Setting original aspect ratio of image useEffect(() => { if (media.uri) { @@ -65,7 +79,6 @@ export const ZoomInCropper: React.FC = ({ screenType, title: title, media: { - filename: media.filename, uri: croppedURL, isVideo: false, }, -- cgit v1.2.3-70-g09d2