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

Use the new gap option

This commit is contained in:
xmflsct
2023-02-11 23:37:17 +01:00
parent b679c0760f
commit 242c75079a
6 changed files with 147 additions and 166 deletions

View File

@ -60,15 +60,23 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
return (
<View
accessibilityLabel={audio.description}
style={[
styles.base,
{
backgroundColor: colors.disabled,
aspectRatio: aspectRatio({ total, index, ...audio.meta?.original })
}
]}
style={{
flex: 1,
flexDirection: 'row',
backgroundColor: colors.disabled,
aspectRatio: aspectRatio({ total, index, ...audio.meta?.original })
}}
>
<View style={styles.overlay}>
<View
style={{
position: 'absolute',
width: '100%',
height: '100%',
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}}
>
{sensitiveShown ? (
audio.blurhash ? (
<GracefullyImage
@ -88,7 +96,7 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
default: { uri: audio.preview_url },
remote: { uri: audio.preview_remote_url }
}}
style={styles.background}
style={{ position: 'absolute', width: '100%', height: '100%' }}
dim
/>
) : null}
@ -139,22 +147,4 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
)
}
const styles = StyleSheet.create({
base: {
flex: 1,
flexBasis: '50%',
padding: StyleConstants.Spacing.XS / 2,
flexDirection: 'row'
},
background: { position: 'absolute', width: '100%', height: '100%' },
overlay: {
position: 'absolute',
width: '100%',
height: '100%',
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
})
export default AttachmentAudio