Fix draft image pres with 4+ images (#10765)
This commit is contained in:
@@ -127,10 +127,12 @@ export function ImageItem({
|
|||||||
thumbnail,
|
thumbnail,
|
||||||
alt,
|
alt,
|
||||||
children,
|
children,
|
||||||
|
maxWidth = 100,
|
||||||
}: {
|
}: {
|
||||||
thumbnail?: string
|
thumbnail?: string
|
||||||
alt?: string
|
alt?: string
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
|
maxWidth?: number
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|
||||||
@@ -141,7 +143,7 @@ export function ImageItem({
|
|||||||
{backgroundColor: 'black'},
|
{backgroundColor: 'black'},
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.aspect_square,
|
a.aspect_square,
|
||||||
{maxWidth: 100},
|
{maxWidth},
|
||||||
a.rounded_xs,
|
a.rounded_xs,
|
||||||
]}
|
]}
|
||||||
accessibilityLabel={alt}
|
accessibilityLabel={alt}
|
||||||
@@ -152,7 +154,7 @@ export function ImageItem({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[a.relative, a.flex_1, a.aspect_square, {maxWidth: 100}]}>
|
<View style={[a.relative, a.flex_1, a.aspect_square, {maxWidth}]}>
|
||||||
<Image
|
<Image
|
||||||
key={thumbnail}
|
key={thumbnail}
|
||||||
source={{uri: thumbnail}}
|
source={{uri: thumbnail}}
|
||||||
|
|||||||
@@ -326,9 +326,15 @@ function DraftMediaPreview({post}: {post: DraftPostDisplay}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MediaPreview.Outer>
|
<View style={[a.flex_row, a.flex_wrap, {marginLeft: -4, marginRight: -4}]}>
|
||||||
{loadedImages.map((image, i) => (
|
{loadedImages.map((image, i) => (
|
||||||
<MediaPreview.ImageItem key={i} thumbnail={image.url} alt={image.alt} />
|
<View key={i} style={[a.p_2xs, {width: '20%'}]}>
|
||||||
|
<MediaPreview.ImageItem
|
||||||
|
thumbnail={image.url}
|
||||||
|
alt={image.alt}
|
||||||
|
maxWidth={999}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
))}
|
))}
|
||||||
{post.gif && (
|
{post.gif && (
|
||||||
<MediaPreview.GifItem thumbnail={post.gif.url} alt={post.gif.alt} />
|
<MediaPreview.GifItem thumbnail={post.gif.url} alt={post.gif.alt} />
|
||||||
@@ -339,6 +345,6 @@ function DraftMediaPreview({post}: {post: DraftPostDisplay}) {
|
|||||||
alt={post.video.altText}
|
alt={post.video.altText}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</MediaPreview.Outer>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user