diff options
author | Shravya Ramesh <shravs1208@gmail.com> | 2021-06-22 08:26:23 -0700 |
---|---|---|
committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-06-22 08:26:23 -0700 |
commit | 4cb6ccf53bc7bf6a6749e9b04c7e1dd057aab56e (patch) | |
tree | ec1b00b078872a69487f6468395865d5052d7c1e | |
parent | 4ebd761570c174694fe9b006881322695b572eb7 (diff) |
Remove image cropper created before new req
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/components/comments/ImageCropper.tsx | 93 | ||||
-rw-r--r-- | yarn.lock | 5 |
3 files changed, 0 insertions, 99 deletions
diff --git a/package.json b/package.json index 1617adec..300eec0c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "react-native-haptic-feedback": "^1.11.0", "react-native-hyperlink": "^0.0.19", "react-native-image-crop-picker": "^0.36.0", - "react-native-image-crop-tools": "^1.3.6", "react-native-image-pan-zoom": "^2.1.12", "react-native-image-picker": "^4.0.3", "react-native-image-resizer": "^1.4.4", 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; @@ -6457,11 +6457,6 @@ react-native-image-crop-picker@^0.36.0: resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.36.2.tgz#fcb35c1a12d805bedbb6d94a87078e86a6c9b49f" integrity sha512-cTauoEHHzx14ZHA7Pt65e7RVnbn1WRYQz2ufTZp9/05EtNDrdsXwNhgtXdWVFbOhYB8qgUFQjy2NelkBOHIH3g== -react-native-image-crop-tools@^1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/react-native-image-crop-tools/-/react-native-image-crop-tools-1.3.6.tgz#c7060c61f6e81b64b9f279b5e9b2a42f35209d1a" - integrity sha512-MXz+4k6SHwbvRHfifws9Jhd//rEQD5NC/2SKy80cRbc13XsWDA9bkIY396HCQrpwBT8zXLF7DjyTSEq+GqbBMg== - react-native-image-pan-zoom@^2.1.12: version "2.1.12" resolved "https://registry.yarnpkg.com/react-native-image-pan-zoom/-/react-native-image-pan-zoom-2.1.12.tgz#eb98bf56fb5610379bdbfdb63219cc1baca98fd2" |