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