Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Video] Media preview improvements (#5229)

* background color for images that haven't loaded

* fix recordwithmedia not appearing

authored by

Samuel Newman and committed by
GitHub
44f1cd9f 6c6a76b1

+9 -8
+9 -8
src/components/MediaPreview.tsx
··· 10 10 import {Trans} from '@lingui/macro' 11 11 12 12 import {parseTenorGif} from '#/lib/strings/embed-player' 13 - import {atoms as a} from '#/alf' 13 + import {atoms as a, useTheme} from '#/alf' 14 14 import {Text} from '#/components/Typography' 15 15 import {PlayButtonIcon} from '#/components/video/PlayButtonIcon' 16 16 ··· 43 43 ))} 44 44 </Outer> 45 45 ) 46 - } else if (AppBskyEmbedExternal.isView(embed) && embed.external.thumb) { 46 + } else if (AppBskyEmbedExternal.isView(media) && media.external.thumb) { 47 47 let url: URL | undefined 48 48 try { 49 - url = new URL(embed.external.uri) 49 + url = new URL(media.external.uri) 50 50 } catch {} 51 51 if (url) { 52 52 const {success} = parseTenorGif(url) ··· 54 54 return ( 55 55 <Outer style={style}> 56 56 <GifItem 57 - thumbnail={embed.external.thumb} 58 - alt={embed.external.title} 57 + thumbnail={media.external.thumb} 58 + alt={media.external.title} 59 59 /> 60 60 </Outer> 61 61 ) 62 62 } 63 63 } 64 - } else if (AppBskyEmbedVideo.isView(embed)) { 64 + } else if (AppBskyEmbedVideo.isView(media)) { 65 65 return ( 66 66 <Outer style={style}> 67 - <VideoItem thumbnail={embed.thumbnail} alt={embed.alt} /> 67 + <VideoItem thumbnail={media.thumbnail} alt={media.alt} /> 68 68 </Outer> 69 69 ) 70 70 } ··· 91 91 alt?: string 92 92 children?: React.ReactNode 93 93 }) { 94 + const t = useTheme() 94 95 return ( 95 96 <View style={[a.relative, a.flex_1, {aspectRatio: 1, maxWidth: 100}]}> 96 97 <Image 97 98 key={thumbnail} 98 99 source={{uri: thumbnail}} 99 - style={[a.flex_1, a.rounded_xs]} 100 + style={[a.flex_1, a.rounded_xs, t.atoms.bg_contrast_25]} 100 101 contentFit="cover" 101 102 accessible={true} 102 103 accessibilityIgnoresInvertColors