From 4cb6ccf53bc7bf6a6749e9b04c7e1dd057aab56e Mon Sep 17 00:00:00 2001
From: Shravya Ramesh <shravs1208@gmail.com>
Date: Tue, 22 Jun 2021 08:26:23 -0700
Subject: Remove image cropper created before new req

---
 src/components/comments/ImageCropper.tsx | 93 --------------------------------
 1 file changed, 93 deletions(-)
 delete mode 100644 src/components/comments/ImageCropper.tsx

(limited to 'src/components/comments/ImageCropper.tsx')

diff --git a/src/components/comments/ImageCropper.tsx b/src/components/comments/ImageCropper.tsx
deleted file mode 100644
index 9edd5838..00000000
--- a/src/components/comments/ImageCropper.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import {RouteProp} from '@react-navigation/core';
-import {useFocusEffect} from '@react-navigation/native';
-import {StackNavigationProp} from '@react-navigation/stack';
-import React, {useCallback, useRef, useState} from 'react';
-import {Button, StatusBar, View} from 'react-native';
-import {CropView} from 'react-native-image-crop-tools';
-import {MainStackParams} from '../../routes';
-import {HeaderHeight} from '../../utils';
-
-type ImageCropperRouteProps = RouteProp<MainStackParams, 'ImageCropper'>;
-
-type ImageCropperNavigationProps = StackNavigationProp<
-  MainStackParams,
-  'ImageCropper'
->;
-
-interface ImageCropperProps {
-  route: ImageCropperRouteProps;
-  navigation: ImageCropperNavigationProps;
-}
-
-const ImageCropper: React.FC<ImageCropperProps> = ({route, navigation}) => {
-  const {image, title, screenType} = route.params;
-  const cropViewRef = useRef();
-  const aspectRatios = [
-    {width: 9, height: 16},
-    {width: 4, height: 5},
-    {width: 1, height: 1},
-  ];
-  const [aspectRatioIndex, setAspectRatioIndex] = useState<number>(0);
-  //Function to get the parent TabBar navigator and setting the option for this screen.
-  useFocusEffect(
-    useCallback(() => {
-      navigation.dangerouslyGetParent()?.setOptions({
-        tabBarVisible: false,
-      });
-      return () => {
-        navigation.dangerouslyGetParent()?.setOptions({
-          tabBarVisible: true,
-        });
-      };
-    }, [navigation]),
-  );
-  return (
-    <>
-      <StatusBar barStyle="dark-content" />
-      <View
-        style={{
-          flex: 1,
-          paddingTop: HeaderHeight,
-        }}>
-        <Button
-          title={'Toggle Ratio'}
-          onPress={() => {
-            setAspectRatioIndex(
-              aspectRatioIndex < 2 ? aspectRatioIndex + 1 : 0,
-            );
-          }}
-        />
-        <Button
-          title={'Done'}
-          onPress={() => {
-            if (cropViewRef && cropViewRef.current) {
-              cropViewRef.current.saveImage(100);
-            }
-          }}
-        />
-        {image !== undefined && (
-          <CropView
-            sourceUrl={image.sourceURL ? image.sourceURL : ''}
-            style={{
-              position: 'relative',
-              flex: 1,
-              marginBottom: '3%',
-            }}
-            onImageCrop={(res) => {
-              const arr = res.uri.split('/');
-              navigation.navigate('CaptionScreen', {
-                screenType,
-                title,
-                image: {filename: arr[arr.length - 1], path: res.uri},
-              });
-            }}
-            keepAspectRatio
-            aspectRatio={aspectRatios[aspectRatioIndex]}
-          />
-        )}
-      </View>
-    </>
-  );
-};
-
-export default ImageCropper;
-- 
cgit v1.2.3-70-g09d2

