tangled
alpha
login
or
join now
ansxor.ca
/
witchsky.app
forked from
jollywhoppers.com/witchsky.app
1
fork
atom
Bluesky app fork with some witchin' additions 💫
1
fork
atom
overview
issues
pulls
pipelines
clamp gif size (#9610)
authored by
samuel.fm
and committed by
GitHub
2 months ago
afe5db8b
893dd78a
+12
-1
1 changed file
expand all
collapse all
unified
split
src
components
Post
Embed
ExternalEmbed
Gif.tsx
+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
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
115
+
let aspectRatio = 1
116
116
+
if (params.dimensions) {
117
117
+
aspectRatio = clamp(
118
118
+
params.dimensions.width / params.dimensions.height,
119
119
+
0.75,
120
120
+
4,
121
121
+
)
122
122
+
}
123
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
121
-
{aspectRatio: params.dimensions!.width / params.dimensions!.height},
131
131
+
{backgroundColor: t.palette.black},
132
132
+
{aspectRatio},
122
133
style,
123
134
]}>
124
135
<View