aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-09 18:50:15 -0400
committerGitHub <noreply@github.com>2021-07-09 18:50:15 -0400
commit1b2dbdefd7f0f188c3aae9f3fb862a690c123468 (patch)
treee9b88baa252155d3dcad90d6d7b68f195e81be2a /src/components/comments
parent70a9fbcd9aab15be060694fc751cda5f26a81e11 (diff)
parenta0f3288050ec1ea3b9b9fc1320fa54b7f3119bb2 (diff)
Merge pull request #491 from IvanIFChen/tma969-new-caption-screen
[TMA-969] New Caption Screen
Diffstat (limited to 'src/components/comments')
-rw-r--r--src/components/comments/ZoomInCropper.tsx22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/components/comments/ZoomInCropper.tsx b/src/components/comments/ZoomInCropper.tsx
index 7fa88f6e..e624c81c 100644
--- a/src/components/comments/ZoomInCropper.tsx
+++ b/src/components/comments/ZoomInCropper.tsx
@@ -1,7 +1,6 @@
import {RouteProp} from '@react-navigation/core';
-import {useFocusEffect} from '@react-navigation/native';
import {StackNavigationProp} from '@react-navigation/stack';
-import React, {useCallback, useEffect, useState} from 'react';
+import React, {useEffect, useState} from 'react';
import {Image, StyleSheet, TouchableOpacity} from 'react-native';
import {normalize} from 'react-native-elements';
import ImageZoom, {IOnMove} from 'react-native-image-pan-zoom';
@@ -25,7 +24,7 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({
route,
navigation,
}) => {
- const {screenType, title, media} = route.params;
+ const {screenType, media, selectedCategory} = route.params;
const [aspectRatio, setAspectRatio] = useState<number>(1);
// Stores the coordinates of the cropped image
@@ -34,19 +33,6 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({
const [y0, setY0] = useState<number>();
const [y1, setY1] = useState<number>();
- useFocusEffect(
- useCallback(() => {
- navigation.dangerouslyGetParent()?.setOptions({
- tabBarVisible: false,
- });
- return () => {
- navigation.dangerouslyGetParent()?.setOptions({
- tabBarVisible: true,
- });
- };
- }, [navigation]),
- );
-
// Setting original aspect ratio of image
useEffect(() => {
if (media.uri) {
@@ -77,11 +63,11 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({
.then((croppedURL) => {
navigation.navigate('CaptionScreen', {
screenType,
- title: title,
media: {
uri: croppedURL,
isVideo: false,
},
+ selectedCategory,
});
})
.catch((err) => console.log('err: ', err));
@@ -93,8 +79,8 @@ export const ZoomInCropper: React.FC<ZoomInCropperProps> = ({
) {
navigation.navigate('CaptionScreen', {
screenType,
- title: title,
media,
+ selectedCategory,
});
}
};