terry-wallet-login #15

Merged
terry merged 95 commits from terry-wallet-login into terry-staging 2026-06-05 16:32:43 +00:00
2 changed files with 25 additions and 3 deletions
Showing only changes of commit 908f89ac24 - Show all commits

View File

@@ -9,6 +9,7 @@ import { VideoBubble } from "./bubbles/VideoBubble";
import { LinkPreviewCard } from "./LinkPreviewCard"; import { LinkPreviewCard } from "./LinkPreviewCard";
import { formatDateTime } from "./utils/formatTime"; import { formatDateTime } from "./utils/formatTime";
import { FavoriteButton } from "../../favorites/FavoriteButton"; import { FavoriteButton } from "../../favorites/FavoriteButton";
import { BubbleAttachmentDownloadButton } from "./BubbleAttachmentDownloadButton";
export type MessageBubbleVariant = "default" | "latest"; export type MessageBubbleVariant = "default" | "latest";
@@ -106,6 +107,12 @@ export function MessageBubble({
onFavoriteChange?.(post.id, favorited) onFavoriteChange?.(post.id, favorited)
} }
/> />
{isFileBubble && post.attachments.length === 1 ? (
<BubbleAttachmentDownloadButton
postId={post.id}
attachment={post.attachments[0]}
/>
) : null}
</div> </div>
</div> </div>
) : null} ) : null}

View File

@@ -19,7 +19,15 @@ import { FavoriteButton } from "../../../favorites/FavoriteButton";
import { BubbleAttachmentDownloadButton } from "../BubbleAttachmentDownloadButton"; import { BubbleAttachmentDownloadButton } from "../BubbleAttachmentDownloadButton";
import type { MessageBubbleVariant } from "../MessageBubble"; import type { MessageBubbleVariant } from "../MessageBubble";
function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) { function AttachmentRow({
postId,
att,
showDownload,
}: {
postId: string;
att: Attachment;
showDownload: boolean;
}) {
const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename }); const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename });
const displayFilename = filenameWithExtension(att.filename, att.mime); const displayFilename = filenameWithExtension(att.filename, att.mime);
const [previewFailed, setPreviewFailed] = useState(false); const [previewFailed, setPreviewFailed] = useState(false);
@@ -70,7 +78,9 @@ function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
{formatBytes(att.sizeBytes)} {formatBytes(att.sizeBytes)}
</div> </div>
</div> </div>
{showDownload ? (
<BubbleAttachmentDownloadButton postId={postId} attachment={att} /> <BubbleAttachmentDownloadButton postId={postId} attachment={att} />
) : null}
</div> </div>
); );
} }
@@ -195,7 +205,12 @@ export function FileDocBubble({
return ( return (
<div className="flex flex-col gap-3"> <div className="flex flex-col gap-3">
{post.attachments.map((att) => ( {post.attachments.map((att) => (
<AttachmentRow key={att.id} postId={post.id} att={att} /> <AttachmentRow
key={att.id}
postId={post.id}
att={att}
showDownload={post.attachments.length >= 2}
/>
))} ))}
{text ? ( {text ? (
<CollapsibleText className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[15px] font-medium leading-6 text-neutral-100"> <CollapsibleText className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[15px] font-medium leading-6 text-neutral-100">