feat(stream): bubble footer with timestamp and inline favorite/download
Match the Figma 4206-6509 card layout for /browse: every bubble now renders a bottom row with the publish timestamp on the left and the action buttons on the right. Image, album, video, text and link cards show only the FavoriteButton; file-document cards show the FavoriteButton plus a new BubbleAttachmentDownloadButton sized to match. Removes the absolute-positioned favorite from the default variant, drops the right-aligned timestamp block, and strips the inline per-row download button from FileDocBubble's default variant since the download now lives in the footer. The 'latest' masonry variant is untouched so the home page continues to use LatestFileCard's existing internal footer.
This commit is contained in:
@@ -9,6 +9,7 @@ import { VideoBubble } from "./bubbles/VideoBubble";
|
||||
import { LinkPreviewCard } from "./LinkPreviewCard";
|
||||
import { formatDateTime } from "./utils/formatTime";
|
||||
import { FavoriteButton } from "../../favorites/FavoriteButton";
|
||||
import { BubbleAttachmentDownloadButton } from "./BubbleAttachmentDownloadButton";
|
||||
|
||||
export type MessageBubbleVariant = "default" | "latest";
|
||||
|
||||
@@ -47,7 +48,9 @@ export function MessageBubble({
|
||||
Bubble === VideoBubble ||
|
||||
Bubble === ImageBubble ||
|
||||
Bubble === ImageWithTextBubble;
|
||||
const isLatestFileCard = variant === "latest" && Bubble === FileDocBubble;
|
||||
const isFileBubble = Bubble === FileDocBubble;
|
||||
const isLatestVariant = variant === "latest";
|
||||
const isLatestFileCard = isLatestVariant && isFileBubble;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -63,22 +66,47 @@ export function MessageBubble({
|
||||
isVisual || isLatestFileCard ? "p-0" : "px-4 py-3"
|
||||
}`}
|
||||
>
|
||||
{!isLatestFileCard ? (
|
||||
{isLatestVariant && !isFileBubble ? (
|
||||
<FavoriteButton
|
||||
resourceId={post.id}
|
||||
size="sm"
|
||||
className={`absolute z-20 shadow-lg shadow-black/30 ${
|
||||
variant === "latest" ? "bottom-4 right-4" : "right-3 top-3"
|
||||
}`}
|
||||
className="absolute z-20 bottom-4 right-4 shadow-lg shadow-black/30"
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<Bubble post={post} variant={variant} />
|
||||
|
||||
{post.linkPreview ? (
|
||||
<div className={isVisual ? "px-4 pt-3" : "mt-3"}>
|
||||
<LinkPreviewCard preview={post.linkPreview} />
|
||||
</div>
|
||||
) : null}
|
||||
{!isLatestFileCard ? (
|
||||
|
||||
{!isLatestVariant ? (
|
||||
<div
|
||||
className={`flex items-center justify-between gap-3 ${
|
||||
isVisual ? "px-4 pb-3 pt-3" : "mt-3"
|
||||
}`}
|
||||
>
|
||||
<time
|
||||
dateTime={post.publishedAt}
|
||||
className="min-w-0 truncate text-[12px] leading-[19px] text-[#A8A9AE]"
|
||||
>
|
||||
{formatDateTime(post.publishedAt)}
|
||||
</time>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
<FavoriteButton resourceId={post.id} size="sm" />
|
||||
{isFileBubble && post.attachments[0] ? (
|
||||
<BubbleAttachmentDownloadButton
|
||||
postId={post.id}
|
||||
attachment={post.attachments[0]}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{isLatestVariant && !isFileBubble ? (
|
||||
<time
|
||||
dateTime={post.publishedAt}
|
||||
className={`block text-right text-[12px] leading-[19px] text-[#A8A9AE] ${
|
||||
|
||||
Reference in New Issue
Block a user