1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Added attachment border radius

This commit is contained in:
xmflsct
2023-02-12 23:08:15 +01:00
parent e37a95408c
commit a78fe5ffe8
11 changed files with 68 additions and 64 deletions

View File

@ -64,7 +64,9 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
flex: 1,
flexDirection: 'row',
backgroundColor: colors.shimmerDefault,
aspectRatio: aspectRatio({ total, index, ...audio.meta?.original })
aspectRatio: aspectRatio({ total, index, ...audio.meta?.original }),
borderRadius: StyleConstants.BorderRadius / 2,
overflow: 'hidden'
}}
>
<View

View File

@ -1,4 +1,5 @@
import GracefullyImage from '@components/GracefullyImage'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { View } from 'react-native'
@ -23,7 +24,16 @@ const AttachmentImage = ({
const { colors } = useTheme()
return (
<View style={{ flex: 1, backgroundColor: colors.shimmerDefault, alignContent: 'center', justifyContent: 'center' }}>
<View
style={{
flex: 1,
backgroundColor: colors.shimmerDefault,
alignContent: 'center',
justifyContent: 'center',
borderRadius: StyleConstants.BorderRadius / 2,
overflow: 'hidden'
}}
>
<GracefullyImage
accessibilityLabel={image.description}
hidden={sensitiveShown}

View File

@ -27,7 +27,9 @@ const AttachmentUnsupported: React.FC<Props> = ({ total, index, sensitiveShown,
flex: 1,
aspectRatio: aspectRatio({ total, index, ...attachment.meta?.original }),
justifyContent: 'center',
alignItems: 'center'
alignItems: 'center',
borderRadius: StyleConstants.BorderRadius / 2,
overflow: 'hidden'
}}
>
{attachment.blurhash ? (

View File

@ -56,7 +56,9 @@ const AttachmentVideo: React.FC<Props> = ({
backgroundColor: colors.shimmerDefault,
aspectRatio: aspectRatio({ total, index, ...video.meta?.original }),
alignContent: 'center',
justifyContent: 'center'
justifyContent: 'center',
borderRadius: StyleConstants.BorderRadius / 2,
overflow: 'hidden'
}}
>
<Video

View File

@ -171,31 +171,31 @@ const TimelineAttachment = () => {
}
return (
<View
style={{
marginTop: StyleConstants.Spacing.M,
flex: 1,
gap: StyleConstants.Spacing.XS,
...(isLargeDevice && { maxWidth: 375 })
}}
>
{chunk(status.media_attachments, 2).map((chunk, chunkIndex) => (
<View
key={chunkIndex}
style={{
flex: 1,
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'center',
alignContent: 'stretch',
gap: StyleConstants.Spacing.XS
}}
>
{chunk.map((a, aIndex) => (
<Fragment key={aIndex}>{mapAttachmentType(a, chunkIndex * 2 + aIndex)}</Fragment>
))}
</View>
))}
<View style={{ marginTop: StyleConstants.Spacing.M, ...(isLargeDevice && { maxWidth: 375 }) }}>
<View
style={{
flex: 1,
gap: StyleConstants.Spacing.XS
}}
>
{chunk(status.media_attachments, 2).map((chunk, chunkIndex) => (
<View
key={chunkIndex}
style={{
flex: 1,
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'center',
alignContent: 'stretch',
gap: StyleConstants.Spacing.XS
}}
>
{chunk.map((a, aIndex) => (
<Fragment key={aIndex}>{mapAttachmentType(a, chunkIndex * 2 + aIndex)}</Fragment>
))}
</View>
))}
</View>
{defaultSensitive() &&
(sensitiveShown ? (
@ -231,7 +231,7 @@ const TimelineAttachment = () => {
}}
style={{
position: 'absolute',
top: StyleConstants.Spacing.S * 2,
top: StyleConstants.Spacing.S,
left: StyleConstants.Spacing.S
}}
/>