1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
xmflsct
2022-12-31 14:00:52 +01:00
parent 65e9f41a3b
commit eb385b8872
3 changed files with 85 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ 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, { useState } from 'react'
import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
Dimensions,
@@ -50,6 +50,13 @@ const ScreenImagesViewer = ({
const isZoomed = useSharedValue(false)
const onViewableItemsChanged = useCallback(
({ viewableItems }: { viewableItems: ViewToken[] }) => {
setCurrentIndex(viewableItems[0]?.index || 0)
},
[]
)
return (
<View style={{ backgroundColor: 'black' }}>
<StatusBar hidden />
@@ -107,7 +114,7 @@ const ScreenImagesViewer = ({
/>
</View>
<LongPressGestureHandler
onEnded={() => {
onActivated={() => {
showActionSheetWithOptions(
{
options: [
@@ -207,9 +214,7 @@ const ScreenImagesViewer = ({
/>
)
}}
onViewableItemsChanged={({ viewableItems }: { viewableItems: ViewToken[] }) => {
setCurrentIndex(viewableItems[0]?.index || 0)
}}
onViewableItemsChanged={onViewableItemsChanged}
viewabilityConfig={{
itemVisiblePercentThreshold: 50
}}