fix: cap all embed types to 400px max-width
This commit is contained in:
@@ -19,7 +19,7 @@ export function GenericEmbed({ embed }: GenericEmbedProps) {
|
||||
const providerName = embed.provider ?? hostnameFromUrl(embed.url);
|
||||
|
||||
return (
|
||||
<div className="mt-2 max-w-[520px] bg-surface-channel rounded-[4px] border-l-4 border-border-hard flex overflow-hidden">
|
||||
<div className="mt-2 max-w-[400px] bg-surface-channel rounded-[4px] border-l-4 border-border-hard flex overflow-hidden">
|
||||
<div className="flex-1 p-3 min-w-0">
|
||||
{providerName && (
|
||||
<div className="text-[12px] text-txt-muted font-medium mb-1 truncate">
|
||||
|
||||
@@ -15,7 +15,7 @@ export function ImageEmbed({ embed }: ImageEmbedProps) {
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={embed.title ?? ''}
|
||||
className="max-w-[520px] max-h-[350px] object-contain rounded-lg cursor-pointer hover:opacity-90 transition-opacity"
|
||||
className="max-w-[400px] max-h-[300px] object-contain rounded-lg cursor-pointer hover:opacity-90 transition-opacity"
|
||||
loading="lazy"
|
||||
referrerPolicy="no-referrer"
|
||||
onClick={() => openImagePreview(imageUrl)}
|
||||
|
||||
@@ -29,7 +29,7 @@ export function RichEmbed({ embed }: RichEmbedProps) {
|
||||
if (!embed.embedUrl) return null;
|
||||
|
||||
return (
|
||||
<div className="mt-2 max-w-[520px] rounded-lg overflow-hidden bg-surface-channel border border-white/[0.06]">
|
||||
<div className="mt-2 max-w-[400px] rounded-lg overflow-hidden bg-surface-channel border border-white/[0.06]">
|
||||
{isLoaded ? (
|
||||
<iframe
|
||||
src={embed.embedUrl}
|
||||
|
||||
@@ -11,7 +11,7 @@ export function VideoEmbed({ embed }: VideoEmbedProps) {
|
||||
// Direct video URL — no provider, no embedUrl
|
||||
if (!embed.provider && !embed.embedUrl) {
|
||||
return (
|
||||
<div className="mt-2 max-w-[520px]">
|
||||
<div className="mt-2 max-w-[400px]">
|
||||
<video
|
||||
src={embed.url}
|
||||
controls
|
||||
@@ -28,7 +28,7 @@ export function VideoEmbed({ embed }: VideoEmbedProps) {
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div className="mt-2 max-w-[520px] rounded-lg overflow-hidden bg-surface-channel border border-white/[0.06]">
|
||||
<div className="mt-2 max-w-[400px] rounded-lg overflow-hidden bg-surface-channel border border-white/[0.06]">
|
||||
{/* 16:9 video area */}
|
||||
<div className="relative w-full" style={{ paddingBottom: '56.25%' }}>
|
||||
{isPlaying && embed.embedUrl ? (
|
||||
|
||||
Reference in New Issue
Block a user