Skip to content

Commit 42e6ff6

Browse files
committed
fix: replace TouchableOpacity with NativePressable for improved touch handling
1 parent 0f9aa59 commit 42e6ff6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/mobile/src/components/ui/carousel/MediaCarousel.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { MediaModel } from "@follow/database/schemas/types"
33
import type { ImageSource } from "expo-image"
44
import type { Ref } from "react"
55
import { useEffect, useState } from "react"
6-
import { ScrollView, TouchableOpacity, View } from "react-native"
6+
import { ScrollView, View } from "react-native"
77
import Animated, {
88
interpolateColor,
99
useAnimatedStyle,
@@ -16,6 +16,7 @@ import { EntryGridFooter } from "@/src/modules/entry-content/EntryGridFooter"
1616
import { Image } from "../image/Image"
1717
import { ImageContextMenu } from "../image/ImageContextMenu"
1818
import { getAllSources } from "../image/utils"
19+
import { NativePressable } from "../pressable/NativePressable"
1920
import { VideoPlayer } from "../video/VideoPlayer"
2021

2122
export const MediaCarousel = ({
@@ -70,7 +71,7 @@ export const MediaCarousel = ({
7071
height: 400,
7172
}
7273
const ImageItem = (
73-
<TouchableOpacity
74+
<NativePressable
7475
onPress={() => {
7576
const [placeholder] = getAllSources({ uri: imageUrl }, proxy)
7677
onPreview?.(index, { blurhash: m.blurhash, ...placeholder })
@@ -84,7 +85,7 @@ export const MediaCarousel = ({
8485
aspectRatio={aspectRatio}
8586
placeholderContentFit="cover"
8687
/>
87-
</TouchableOpacity>
88+
</NativePressable>
8889
)
8990

9091
if (m.type === "photo") {

0 commit comments

Comments
 (0)