mirror of
https://github.com/spacebarchat/client.git
synced 2024-11-22 02:12:38 +01:00
more minor embed styling fixes
This commit is contained in:
parent
c553c6c1e9
commit
45d1064384
@ -15,7 +15,7 @@ iframe {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.image {
|
||||
.embedImage {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@ -157,6 +157,10 @@ iframe {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.embedThumbnail {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
img.image {
|
||||
cursor: pointer;
|
||||
object-fit: fill;
|
||||
|
@ -90,9 +90,10 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) {
|
||||
default: {
|
||||
if (embed.video && !thumbnail) {
|
||||
const url = embed.video.url;
|
||||
|
||||
return (
|
||||
<video
|
||||
className={styles.image}
|
||||
className={styles.embedImage}
|
||||
style={{ width, height }}
|
||||
src={url}
|
||||
loop={embed.type === EmbedType.GIFV}
|
||||
@ -103,9 +104,10 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) {
|
||||
);
|
||||
} else if (embed.image && !thumbnail) {
|
||||
const url = embed.image.url;
|
||||
|
||||
return (
|
||||
<img
|
||||
className={styles.image}
|
||||
className={styles.embedImage}
|
||||
src={url}
|
||||
loading="lazy"
|
||||
style={{ width: "100%", height: "100%" }}
|
||||
@ -117,9 +119,10 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) {
|
||||
);
|
||||
} else if (embed.thumbnail) {
|
||||
const url = embed.thumbnail.url;
|
||||
|
||||
return (
|
||||
<img
|
||||
className={styles.image}
|
||||
className={thumbnail ? styles.embedThumbnail : styles.embedImage}
|
||||
src={url}
|
||||
loading="lazy"
|
||||
style={{ width, height }}
|
||||
|
@ -162,21 +162,19 @@ function MessageEmbed({ embed }: Props) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{/* FIXME: broken with wide images */}
|
||||
{(!largeMedia || embed.type === EmbedType.Rich) && embed.thumbnail && (
|
||||
{(!largeMedia || embed.type === EmbedType.Rich) && embed.thumbnail && (
|
||||
<div>
|
||||
<EmbedMedia embed={embed} width={80} thumbnail />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{/* FIXME: broken with wide images */}
|
||||
{(largeMedia || embed.type === EmbedType.Rich) && (
|
||||
<EmbedMedia embed={embed} height={height} width={width} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{(largeMedia || embed.type === EmbedType.Rich) && (
|
||||
<div>
|
||||
<EmbedMedia embed={embed} height={height} width={width} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{embed.footer && (
|
||||
<div className={styles.embedFooter}>
|
||||
{embed.footer.icon_url && (
|
||||
|
Loading…
Reference in New Issue
Block a user