Bluesky app fork with some witchin' additions 💫

clamp gif size (#9610)

authored by samuel.fm and committed by

GitHub afe5db8b 893dd78a

+12 -1
+12 -1
src/components/Post/Embed/ExternalEmbed/Gif.tsx
··· 11 11 import {useLingui} from '@lingui/react' 12 12 13 13 import {HITSLOP_20} from '#/lib/constants' 14 + import {clamp} from '#/lib/numbers' 14 15 import {type EmbedPlayerParams} from '#/lib/strings/embed-player' 15 16 import {isWeb} from '#/platform/detection' 16 17 import {useAutoplayDisabled} from '#/state/preferences' ··· 111 112 playerRef.current?.toggleAsync() 112 113 }, []) 113 114 115 + let aspectRatio = 1 116 + if (params.dimensions) { 117 + aspectRatio = clamp( 118 + params.dimensions.width / params.dimensions.height, 119 + 0.75, 120 + 4, 121 + ) 122 + } 123 + 114 124 return ( 115 125 <View 116 126 style={[ ··· 118 128 a.overflow_hidden, 119 129 a.border, 120 130 t.atoms.border_contrast_low, 121 - {aspectRatio: params.dimensions!.width / params.dimensions!.height}, 131 + {backgroundColor: t.palette.black}, 132 + {aspectRatio}, 122 133 style, 123 134 ]}> 124 135 <View