From 9967cc8954f0e45403ad743cda0774897c56ff08 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Fri, 18 Jun 2021 17:26:33 +0900 Subject: Get data --- src/components/comments/ZoomInCropper.tsx | 41 +++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'src/components/comments') diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx index 4e8f9e7c..d238d6ae 100644 --- a/src/components/comments/ZoomInCropper.tsx +++ b/src/components/comments/ZoomInCropper.tsx @@ -1,12 +1,18 @@ import {RouteProp} from '@react-navigation/core'; import {StackNavigationProp} from '@react-navigation/stack'; import React, {useEffect, useState} from 'react'; -import {Dimensions, Image, StyleSheet, TouchableOpacity} from 'react-native'; +import { + Dimensions, + Image, + StyleSheet, + TouchableOpacity, + Alert, +} from 'react-native'; import {normalize} from 'react-native-elements'; import ImageZoom from 'react-native-image-pan-zoom'; import CloseIcon from '../../assets/ionicons/close-outline.svg'; import {MainStackParams} from '../../routes'; -import {HeaderHeight, SCREEN_WIDTH} from '../../utils'; +import {HeaderHeight, SCREEN_WIDTH, SCREEN_HEIGHT} from '../../utils'; import {TaggSquareButton} from '../common'; type ZoomInCropperRouteProps = RouteProp; @@ -51,11 +57,22 @@ export const ZoomInCropper: React.FC = ({ + imageHeight={SCREEN_WIDTH / aspectRatio} + onMove={(position) => + console.log( + 'hi', + position.positionX, + position.positionY, + position.scale, + position.zoomCurrentDistance, + SCREEN_WIDTH, + SCREEN_HEIGHT, + ) + }> = ({ /> console.log('Navigate to caption screen')} + onPress={() => { + if (image && image.filename && image.sourceURL) { + navigation.navigate('CaptionScreen', { + screenType, + title: title, + image: {filename: image.filename, path: image.sourceURL}, + }); + } else { + Alert.alert('Invalid image file.'); + } + }} title={'Next'} buttonStyle={'normal'} buttonColor={'blue'} -- cgit v1.2.3-70-g09d2