Unify message bubble width
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 21s

This commit is contained in:
TerryM
2026-05-27 12:46:31 +08:00
parent 902300933e
commit 1f3acca211

View File

@@ -27,18 +27,11 @@ export function MessageBubble({ post }: { post: Post }) {
const { lang } = useI18n(); const { lang } = useI18n();
const Bubble = pickBubble(post); const Bubble = pickBubble(post);
const isTextOnly = post.attachments.length === 0; const isTextOnly = post.attachments.length === 0;
const isVisual = post.attachments.some(
(a) => a.kind === "image" || a.kind === "video",
);
return ( return (
<article <article
id={`post-${post.id}`} id={`post-${post.id}`}
className={`relative mx-auto rounded-2xl bg-ark-panel text-left shadow-sm ${ className={`relative mx-auto w-full max-w-[380px] rounded-2xl bg-ark-panel text-left shadow-sm md:max-w-[680px] lg:max-w-[900px] xl:max-w-[1120px] ${isTextOnly ? "px-3 py-2" : "p-2"}`}
isVisual
? "w-full max-w-[380px] md:max-w-[680px] lg:max-w-[900px] xl:max-w-[1120px]"
: "inline-block max-w-[92%] md:max-w-[680px] lg:max-w-[760px] xl:max-w-[820px]"
} ${isTextOnly ? "px-3 py-2" : "p-2"}`}
> >
<Bubble post={post} /> <Bubble post={post} />
<time <time