mirror of
https://github.com/spacebarchat/client.git
synced 2024-11-22 10:22:30 +01:00
some embed tweaks
This commit is contained in:
parent
32208f5ef3
commit
03a77f7c4f
@ -18,6 +18,7 @@ iframe {
|
|||||||
.embedImage {
|
.embedImage {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.website {
|
.website {
|
||||||
@ -100,6 +101,7 @@ iframe {
|
|||||||
|
|
||||||
.embedDescription {
|
.embedDescription {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
line-height: 16px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
@ -128,7 +128,6 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) {
|
|||||||
className={styles.embedImage}
|
className={styles.embedImage}
|
||||||
src={url}
|
src={url}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
style={{ width: "100%", height: "100%" }}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
modalController.push({
|
modalController.push({
|
||||||
type: "image_viewer",
|
type: "image_viewer",
|
||||||
@ -145,7 +144,7 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) {
|
|||||||
className={thumbnail ? styles.embedThumbnail : styles.embedImage}
|
className={thumbnail ? styles.embedThumbnail : styles.embedImage}
|
||||||
src={url}
|
src={url}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
style={{ width, height }}
|
style={{ width: thumbnail ? width : undefined, height }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
modalController.push({
|
modalController.push({
|
||||||
type: "image_viewer",
|
type: "image_viewer",
|
||||||
|
@ -11,7 +11,7 @@ import styles from "./Embed.module.css";
|
|||||||
import EmbedMedia from "./EmbedMedia";
|
import EmbedMedia from "./EmbedMedia";
|
||||||
import { MESSAGE_AREA_PADDING, MessageAreaWidthContext } from "./MessageList";
|
import { MESSAGE_AREA_PADDING, MessageAreaWidthContext } from "./MessageList";
|
||||||
|
|
||||||
const MAX_EMBED_WIDTH = 300;
|
const MAX_EMBED_WIDTH = 400;
|
||||||
const MAX_EMBED_HEIGHT = 640;
|
const MAX_EMBED_HEIGHT = 640;
|
||||||
const THUMBNAIL_MAX_WIDTH = 80;
|
const THUMBNAIL_MAX_WIDTH = 80;
|
||||||
const CONTAINER_PADDING = 24;
|
const CONTAINER_PADDING = 24;
|
||||||
@ -108,7 +108,7 @@ function MessageEmbed({ embed }: Props) {
|
|||||||
className={styles.embedAuthorIcon}
|
className={styles.embedAuthorIcon}
|
||||||
src={embed.author.icon_url}
|
src={embed.author.icon_url}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
onError={(e) => (e.currentTarget.style.display = "none")}
|
// onError={(e) => (e.currentTarget.style.display = "none")}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{embed.author.url ? (
|
{embed.author.url ? (
|
||||||
@ -190,7 +190,7 @@ function MessageEmbed({ embed }: Props) {
|
|||||||
className={styles.embedFooterIcon}
|
className={styles.embedFooterIcon}
|
||||||
src={embed.footer.icon_url}
|
src={embed.footer.icon_url}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
onError={(e) => (e.currentTarget.style.display = "none")}
|
// onError={(e) => (e.currentTarget.style.display = "none")}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<span className={styles.embedFooterText}>
|
<span className={styles.embedFooterText}>
|
||||||
|
Loading…
Reference in New Issue
Block a user