aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-06-18 10:53:22 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-06-18 10:53:22 -0700
commit45b46077191c0515c250b592b9da11ae42d46f51 (patch)
tree00b0e9e864d3fe93d611397a5301f1026b9af900 /src/components/comments
parent5449a11f4c404e505ba4369bbdbefd73eeda0be3 (diff)
parent75b3f820d05efe419b864a1e830d97dd9741b45b (diff)
Merge branch 'image-cropper' of https://github.com/shravyaramesh/Frontend into image-cropper
Diffstat (limited to 'src/components/comments')
-rw-r--r--src/components/comments/ZoomInCropper.tsx37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx
index 79047b41..4b35464c 100644
--- a/src/components/comments/ZoomInCropper.tsx
+++ b/src/components/comments/ZoomInCropper.tsx
@@ -1,22 +1,14 @@
import {RouteProp} from '@react-navigation/core';
-import {useFocusEffect} from '@react-navigation/native';
import {StackNavigationProp} from '@react-navigation/stack';
-import React, {useCallback, useEffect, useState} from 'react';
-import {
- Dimensions,
- Image,
- StyleSheet,
- TouchableOpacity,
- View,
-} from 'react-native';
+import {default as React, 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';
+import PhotoManipulator from 'react-native-photo-manipulator';
import CloseIcon from '../../assets/ionicons/close-outline.svg';
import {MainStackParams} from '../../routes';
import {HeaderHeight, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
-import {LoadingIndicator, TaggSquareButton} from '../common';
-import PhotoManipulator from 'react-native-photo-manipulator';
-import {trackPromise} from 'react-promise-tracker';
+import {TaggSquareButton} from '../common';
type ZoomInCropperRouteProps = RouteProp<MainStackParams, 'ZoomInCropper'>;
type ZoomInCropperNavigationProps = StackNavigationProp<
@@ -35,18 +27,11 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({
const {screenType, title, image} = route.params;
const [aspectRatio, setAspectRatio] = useState<number>(1);
- useFocusEffect(
- useCallback(() => {
- navigation.dangerouslyGetParent()?.setOptions({
- tabBarVisible: false,
- });
- return () => {
- navigation.dangerouslyGetParent()?.setOptions({
- tabBarVisible: true,
- });
- };
- }, [navigation]),
- );
+ useEffect(() => {
+ navigation.dangerouslyGetParent()?.setOptions({
+ tabBarVisible: false,
+ });
+ }, []);
useEffect(() => {
if (image.sourceURL) {
@@ -132,8 +117,8 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({
</TouchableOpacity>
<ImageZoom
style={{backgroundColor: 'black'}}
- cropWidth={Dimensions.get('window').width}
- cropHeight={Dimensions.get('window').height}
+ cropWidth={SCREEN_WIDTH}
+ cropHeight={SCREEN_HEIGHT}
imageWidth={SCREEN_WIDTH}
imageHeight={SCREEN_WIDTH / aspectRatio}
onMove={onMove}>