mirror of
https://github.com/wassname/talk.git
synced 2026-08-07 11:29:44 +08:00
Enforce max width on mod card embeds (#3019)
Some gifs are too wide for the mod cards. Set a max-width and force it on the media/iframe so that it doesn't push out mod card controls. CORL-1179
This commit is contained in:
@@ -28,7 +28,13 @@ const GiphyMedia: FunctionComponent<Props> = ({
|
||||
<div className={styles.embed}>
|
||||
{!showAnimated && still && (
|
||||
<BaseButton onClick={toggleImage} className={styles.toggle}>
|
||||
<img src={still} className={styles.image} alt={title || ""} />
|
||||
<img
|
||||
src={still}
|
||||
className={styles.image}
|
||||
width={width || undefined}
|
||||
height={height || undefined}
|
||||
alt={title || ""}
|
||||
/>
|
||||
<Flex
|
||||
direction="column"
|
||||
alignItems="center"
|
||||
@@ -47,8 +53,10 @@ const GiphyMedia: FunctionComponent<Props> = ({
|
||||
{showAnimated && video && (
|
||||
<BaseButton onClick={toggleImage}>
|
||||
<video
|
||||
className={styles.image}
|
||||
width={width || undefined}
|
||||
height={height || undefined}
|
||||
title={title || ""}
|
||||
autoPlay
|
||||
loop
|
||||
>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
.embed {
|
||||
margin: var(--spacing-2) 0;
|
||||
|
||||
max-width: 100%;
|
||||
& > iframe {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.toggle {
|
||||
@@ -30,4 +35,5 @@
|
||||
|
||||
.image {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user