diff options
Diffstat (limited to 'src/view/com/util/images/Gallery.tsx')
-rw-r--r-- | src/view/com/util/images/Gallery.tsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/view/com/util/images/Gallery.tsx b/src/view/com/util/images/Gallery.tsx index 38137cc49..e277b7e86 100644 --- a/src/view/com/util/images/Gallery.tsx +++ b/src/view/com/util/images/Gallery.tsx @@ -1,6 +1,6 @@ -import React, {ComponentProps, FC} from 'react' -import {Pressable, View} from 'react-native' -import {Image} from 'expo-image' +import React from 'react' +import {Pressable, StyleProp, View, ViewStyle} from 'react-native' +import {Image, ImageStyle} from 'expo-image' import {AppBskyEmbedImages} from '@atproto/api' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -13,17 +13,18 @@ import {Text} from '#/components/Typography' type EventFunction = (index: number) => void -interface GalleryItemProps { +interface Props { images: AppBskyEmbedImages.ViewImage[] index: number onPress?: EventFunction onLongPress?: EventFunction onPressIn?: EventFunction - imageStyle?: ComponentProps<typeof Image>['style'] + imageStyle?: StyleProp<ImageStyle> viewContext?: PostEmbedViewContext + insetBorderStyle?: StyleProp<ViewStyle> } -export const GalleryItem: FC<GalleryItemProps> = ({ +export function GalleryItem({ images, index, imageStyle, @@ -31,7 +32,8 @@ export const GalleryItem: FC<GalleryItemProps> = ({ onPressIn, onLongPress, viewContext, -}) => { + insetBorderStyle, +}: Props) { const t = useTheme() const {_} = useLingui() const largeAltBadge = useLargeAltBadgeEnabled() @@ -47,7 +49,6 @@ export const GalleryItem: FC<GalleryItemProps> = ({ onLongPress={onLongPress ? () => onLongPress(index) : undefined} style={[ a.flex_1, - a.rounded_sm, a.overflow_hidden, t.atoms.bg_contrast_25, imageStyle, @@ -63,7 +64,7 @@ export const GalleryItem: FC<GalleryItemProps> = ({ accessibilityHint="" accessibilityIgnoresInvertColors /> - <MediaInsetBorder /> + <MediaInsetBorder style={insetBorderStyle} /> </Pressable> {hasAlt && !hideBadges ? ( <View |