1
0
mirror of https://github.com/tooot-app/app synced 2025-01-20 21:10:33 +01:00

Fix long image

This commit is contained in:
Zhiyuan Zheng 2022-02-12 22:16:29 +01:00
parent 3a7eec53ec
commit e8fa5f2acb

View File

@ -28,17 +28,16 @@ const AttachmentImage = React.memo(
uri={{ original: image.preview_url, remote: image.remote_url }}
blurhash={image.blurhash}
onPress={onPress}
style={[
{
aspectRatio:
total > 1 ||
!image.meta?.original?.width ||
!image.meta?.original?.height ||
image.meta.original.width / image.meta.original.height > 2
? attachmentAspectRatio({ total, index })
: image.meta.original.width / image.meta.original.height
}
]}
style={{
aspectRatio:
total > 1 ||
!image.meta?.original?.width ||
!image.meta?.original?.height
? attachmentAspectRatio({ total, index })
: image.meta.original.height / image.meta.original.width > 2
? 0.5
: image.meta.original.width / image.meta.original.height
}}
/>
</View>
)