aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/ZoomInCropper.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-06-17 23:09:32 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-06-17 23:09:32 -0700
commit4258a121e87a7538f9f45a56b0e4fb76f1f395dd (patch)
treeeb66f998161ea387d67a98a45ddfe9521f176198 /src/components/comments/ZoomInCropper.tsx
parent67fcb0b963a9f38451a382803bcfaa5fb001cded (diff)
Add pan zoom library
Diffstat (limited to 'src/components/comments/ZoomInCropper.tsx')
-rw-r--r--src/components/comments/ZoomInCropper.tsx30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx
new file mode 100644
index 00000000..1620d777
--- /dev/null
+++ b/src/components/comments/ZoomInCropper.tsx
@@ -0,0 +1,30 @@
+import {RouteProp} from '@react-navigation/core';
+import {StackNavigationProp} from '@react-navigation/stack';
+import React from 'react';
+import {Image, Dimensions, Text} from 'react-native';
+import ImageZoom from 'react-native-image-pan-zoom';
+import {SCREEN_WIDTH} from '../../utils';
+import {MainStackParams} from '../../routes';
+
+type ZoomInCropperRouteProps = RouteProp<MainStackParams, 'ZoomInCropper'>;
+
+interface ZoomInCropperProps {
+ route: ZoomInCropperRouteProps;
+}
+
+export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({route}) => {
+ return (
+ <ImageZoom
+ cropWidth={Dimensions.get('window').width}
+ cropHeight={Dimensions.get('window').height}
+ imageWidth={200}
+ imageHeight={200}>
+ <Image
+ style={{width: 200, height: 200}}
+ source={{
+ uri: route.params.imageURI,
+ }}
+ />
+ </ImageZoom>
+ );
+};