diff options
author | Brian Kim <brian@tagg.id> | 2021-06-19 03:12:58 +0900 |
---|---|---|
committer | Brian Kim <brian@tagg.id> | 2021-06-19 03:12:58 +0900 |
commit | 947a06a323ebf69be3454801148814792df664ea (patch) | |
tree | cb274f9f4fc925630781dcdf5bba6f7f2ab936e1 | |
parent | 5e021bada5b082ee40195399778bf68bbca3d97b (diff) |
Got cropper working
-rw-r--r-- | src/components/comments/ZoomInCropper.tsx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx index 4b35464c..85b25541 100644 --- a/src/components/comments/ZoomInCropper.tsx +++ b/src/components/comments/ZoomInCropper.tsx @@ -61,8 +61,26 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({ width: Math.abs(x0 - x1), height: Math.abs(y0 - y1), }) - .then((croppedURL) => console.log('croppedURL: ', croppedURL)) + .then((croppedURL) => { + navigation.navigate('CaptionScreen', { + screenType, + title: title, + image: {filename: croppedURL, path: croppedURL}, + }); + }) .catch((err) => console.log('err: ', err)); + } else if ( + x0 === undefined && + x1 === undefined && + y0 === undefined && + y1 === undefined && + image.sourceURL + ) { + navigation.navigate('CaptionScreen', { + screenType, + title: title, + image: {filename: image.sourceURL, path: image.sourceURL}, + }); } console.log('crop photo and send to caption screen'); }; |