feat(mobile): remove noPreview param
This commit is contained in:
@@ -19,14 +19,11 @@ export const MediaCarousel = ({
|
||||
media,
|
||||
onPreview,
|
||||
aspectRatio,
|
||||
|
||||
noPreview,
|
||||
}: {
|
||||
entryId: string
|
||||
media: MediaModel[]
|
||||
onPreview?: () => void
|
||||
aspectRatio: number
|
||||
noPreview?: boolean
|
||||
}) => {
|
||||
const [containerWidth, setContainerWidth] = useState(0)
|
||||
const containerHeight = Math.floor(containerWidth / aspectRatio)
|
||||
@@ -35,8 +32,6 @@ export const MediaCarousel = ({
|
||||
// const activeIndex = useSharedValue(0)
|
||||
const [activeIndex, setActiveIndex] = useState(0)
|
||||
|
||||
const Wrapper = noPreview ? View : ImageContextMenu
|
||||
|
||||
return (
|
||||
<View
|
||||
onLayout={(e) => {
|
||||
@@ -67,7 +62,7 @@ export const MediaCarousel = ({
|
||||
className="relative"
|
||||
style={{ width: containerWidth, height: containerHeight }}
|
||||
>
|
||||
<Wrapper entryId={entryId} imageUrl={m.url}>
|
||||
<ImageContextMenu entryId={entryId} imageUrl={m.url}>
|
||||
<Galeria.Image onPreview={onPreview} index={index}>
|
||||
<Image
|
||||
proxy={{
|
||||
@@ -80,7 +75,7 @@ export const MediaCarousel = ({
|
||||
placeholderContentFit="cover"
|
||||
/>
|
||||
</Galeria.Image>
|
||||
</Wrapper>
|
||||
</ImageContextMenu>
|
||||
</View>
|
||||
)
|
||||
} else if (m.preview_image_url) {
|
||||
|
||||
@@ -56,13 +56,11 @@ const MediaItems = ({
|
||||
media,
|
||||
entryId,
|
||||
onPreview,
|
||||
noPreview,
|
||||
aspectRatio,
|
||||
}: {
|
||||
media: MediaModel[]
|
||||
entryId: string
|
||||
onPreview?: () => void
|
||||
noPreview?: boolean
|
||||
aspectRatio?: number
|
||||
}) => {
|
||||
const firstMedia = media[0]
|
||||
@@ -85,7 +83,6 @@ const MediaItems = ({
|
||||
media={uniqMedia}
|
||||
onPreview={onPreview}
|
||||
aspectRatio={realAspectRatio}
|
||||
noPreview={noPreview}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user