Fix alt text for GIFs (#4766)

* fix alt text dialog for gifs

* only apply to native
zio/stable
Hailey 2024-07-10 12:25:44 -07:00 committed by GitHub
parent fa64d9393b
commit 65b5d31b58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 4 deletions

View File

@ -174,8 +174,13 @@ function AltTextInner({
<Text style={[a.text_2xl, a.font_bold, a.leading_tight, a.pb_sm]}> <Text style={[a.text_2xl, a.font_bold, a.leading_tight, a.pb_sm]}>
<Trans>Add alt text</Trans> <Trans>Add alt text</Trans>
</Text> </Text>
<View style={[a.w_full, a.align_center, native({maxHeight: 200})]}> <View style={[a.align_center]}>
<GifEmbed link={link} params={params} hideAlt /> <GifEmbed
link={link}
params={params}
hideAlt
style={[native({maxHeight: 225})]}
/>
</View> </View>
</View> </View>
</View> </View>

View File

@ -1,5 +1,12 @@
import React from 'react' import React from 'react'
import {Pressable, StyleSheet, TouchableOpacity, View} from 'react-native' import {
Pressable,
StyleProp,
StyleSheet,
TouchableOpacity,
View,
ViewStyle,
} from 'react-native'
import {AppBskyEmbedExternal} from '@atproto/api' import {AppBskyEmbedExternal} from '@atproto/api'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
@ -89,10 +96,12 @@ export function GifEmbed({
params, params,
link, link,
hideAlt, hideAlt,
style = {width: '100%'},
}: { }: {
params: EmbedPlayerParams params: EmbedPlayerParams
link: AppBskyEmbedExternal.ViewExternal link: AppBskyEmbedExternal.ViewExternal
hideAlt?: boolean hideAlt?: boolean
style?: StyleProp<ViewStyle>
}) { }) {
const {_} = useLingui() const {_} = useLingui()
const autoplayDisabled = useAutoplayDisabled() const autoplayDisabled = useAutoplayDisabled()
@ -124,7 +133,7 @@ export function GifEmbed({
) )
return ( return (
<View style={[a.rounded_sm, a.overflow_hidden, a.mt_sm, {width: '100%'}]}> <View style={[a.rounded_sm, a.overflow_hidden, a.mt_sm, style]}>
<View <View
style={[ style={[
a.rounded_sm, a.rounded_sm,