import GracefullyImage from '@components/GracefullyImage' import { HeaderCenter, HeaderLeft, HeaderRight } from '@components/Header' import { useActionSheet } from '@expo/react-native-action-sheet' import { androidActionSheetStyles } from '@utils/helpers/androidActionSheetStyles' import { RootStackScreenProps } from '@utils/navigation/navigators' import { useTheme } from '@utils/styles/ThemeManager' import React, { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import { Dimensions, FlatList, PixelRatio, Platform, Share, StatusBar, View, ViewToken } from 'react-native' import { Directions, Gesture, LongPressGestureHandler } from 'react-native-gesture-handler' import { runOnJS, useSharedValue } from 'react-native-reanimated' import { createZoomListComponent, Zoom } from 'react-native-reanimated-zoom' import { useSafeAreaInsets } from 'react-native-safe-area-context' import saveImage from './save' const ZoomFlatList = createZoomListComponent(FlatList) const ScreenImagesViewer = ({ route: { params: { imageUrls, id, hideCounter } }, navigation }: RootStackScreenProps<'Screen-ImagesViewer'>) => { if (imageUrls.length === 0) { navigation.goBack() return null } const WINDOW_WIDTH = Dimensions.get('window').width const WINDOW_HEIGHT = Dimensions.get('window').height const insets = useSafeAreaInsets() const { colors } = useTheme() const { t } = useTranslation(['common', 'screenImageViewer']) const initialIndex = imageUrls.findIndex(image => image.id === id) const [currentIndex, setCurrentIndex] = useState(initialIndex) const { showActionSheetWithOptions } = useActionSheet() const isZoomed = useSharedValue(false) const onViewableItemsChanged = useCallback( ({ viewableItems }: { viewableItems: ViewToken[] }) => { setCurrentIndex(viewableItems[0]?.index || 0) }, [] ) return ( ) } export default ScreenImagesViewer