From 2558aa96ed811d54b9696a208bf43d53137cc6c6 Mon Sep 17 00:00:00 2001 From: LanQin_ Date: Thu, 25 Jun 2026 16:17:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(mail):=20=E7=BB=9F=E4=B8=80=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E8=8F=9C=E5=8D=95=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将邮件页右键菜单中的原生 `button` 替换为 `Button` 组件。 - 抽取通用按钮样式,统一打开、刷新、移动、标签等菜单项表现。 - 保持删除等危险操作的视觉强调一致。 --- apps/web/src/pages/mail.tsx | 47 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/apps/web/src/pages/mail.tsx b/apps/web/src/pages/mail.tsx index 03a815c..6863927 100644 --- a/apps/web/src/pages/mail.tsx +++ b/apps/web/src/pages/mail.tsx @@ -1822,6 +1822,7 @@ function SidebarContextMenu({ state, canOrganize, pending, onClose, onOpen, onRe const item = state.item const customFolder = item.type === "folder" && item.custom const position = contextMenuPosition(state.x, state.y) + const itemClass = "h-auto w-full justify-start rounded px-2 py-1.5 text-left font-normal" return (
event.preventDefault()} role="menu" > - - + + {canOrganize && ( - + )} {canOrganize && customFolder && ( <>
- - + - + - + +
- + )}
@@ -1889,14 +1890,14 @@ function MessageContextMenu({ state, labels, folders, canSend, canOrganize, canM const { message } = state const position = contextMenuPosition(state.x, state.y) const draft = message.folder === "Drafts" - const itemClass = "flex w-full items-center gap-2 rounded-sm px-3 py-2 text-left text-sm outline-none transition-colors hover:bg-accent focus:bg-accent disabled:pointer-events-none disabled:opacity-50" + const itemClass = "h-auto w-full justify-start rounded-sm px-3 py-2 text-left font-normal" function item(label: string, icon: React.ReactNode, action: Parameters[0], destructive = false) { return ( - + ) } function toggleLabel(label: MailLabel) { @@ -1941,11 +1942,11 @@ function MessageContextMenu({ state, labels, folders, canSend, canOrganize, canM
移动到
{movableFolders.map((folder) => ( - + ))}
@@ -1959,11 +1960,11 @@ function MessageContextMenu({ state, labels, folders, canSend, canOrganize, canM const active = (message.labels || []).some((item) => item.id === label.id) const colors = generateLabelColor(label.name) return ( - + ) })}