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 {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 {TaggSquareButton} from '../common'; type ZoomInCropperRouteProps = RouteProp; type ZoomInCropperNavigationProps = StackNavigationProp< MainStackParams, 'ZoomInCropper' >; interface ZoomInCropperProps { route: ZoomInCropperRouteProps; navigation: ZoomInCropperNavigationProps; } export const ZoomInCropper: React.FC = ({ route, navigation, }) => { const {screenType, title, image} = route.params; const [aspectRatio, setAspectRatio] = useState(1); useEffect(() => { navigation.dangerouslyGetParent()?.setOptions({ tabBarVisible: false, }); }, []); useEffect(() => { if (image.sourceURL) { Image.getSize( image.sourceURL, (w, h) => { setAspectRatio(w / h); }, (err) => console.log(err), ); } }, []); return ( <> navigation.goBack()}> console.log('Navigate to caption screen')} title={'Next'} buttonStyle={'normal'} buttonColor={'blue'} labelColor={'white'} style={styles.button} labelStyle={styles.buttonLabel} /> ); }; const styles = StyleSheet.create({ closeButton: { position: 'absolute', top: 0, paddingTop: HeaderHeight, zIndex: 1, marginLeft: '5%', }, button: { zIndex: 1, position: 'absolute', bottom: normalize(20), right: normalize(15), width: normalize(108), height: normalize(25), borderRadius: 10, }, buttonLabel: { fontWeight: '700', fontSize: normalize(15), lineHeight: normalize(17.8), letterSpacing: normalize(1.3), textAlign: 'center', }, });