From b77ebbc1b2f8ba69c76baf23466bd127944daebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 18:54:12 +0800 Subject: [PATCH] =?UTF-8?q?PaneButton=20=E5=B0=BA=E5=AF=B8=E7=B1=BB?= =?UTF-8?q?=E5=90=8D=E6=94=B9=E7=94=A8=E6=9F=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - export/tabs/common/PaneButton.tsx 用 SIZING_CLASS 映射替换 sizing 的嵌套三元 --- .../export/tabs/common/PaneButton.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/project-development/export/tabs/common/PaneButton.tsx b/apps/ai-game-creator-shell/src/view/project-development/export/tabs/common/PaneButton.tsx index aa350a7b6..2003bc7d5 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/export/tabs/common/PaneButton.tsx +++ b/apps/ai-game-creator-shell/src/view/project-development/export/tabs/common/PaneButton.tsx @@ -18,6 +18,13 @@ const TONE_CLASS: Record<'primary' | 'ghost' | 'brand', string> = { 'border-[#e2cbb8] bg-white/80 text-[#6f5848] hover:border-[#c7653d] hover:text-[#c7653d]', }; +/** 尺寸 → 类名,理由同 [`TONE_CLASS`]。 */ +const SIZING_CLASS: Record<'sm' | 'lg' | 'hero', string> = { + hero: 'w-full justify-center gap-2 rounded-xl px-6 py-4 text-lg font-bold tracking-wide shadow-md', + lg: 'justify-center gap-2 rounded-xl px-6 py-3 text-base font-semibold shadow-sm', + sm: 'gap-1.5 rounded-[10px] px-3.5 py-2 text-xs font-semibold', +}; + export function PaneButton({ children, variant = 'ghost', @@ -38,12 +45,7 @@ export function PaneButton({ onClick: () => void; }) { const tone = TONE_CLASS[variant]; - const sizing = - size === 'hero' - ? 'w-full justify-center gap-2 rounded-xl px-6 py-4 text-lg font-bold tracking-wide shadow-md' - : size === 'lg' - ? 'justify-center gap-2 rounded-xl px-6 py-3 text-base font-semibold shadow-sm' - : 'gap-1.5 rounded-[10px] px-3.5 py-2 text-xs font-semibold'; + const sizing = SIZING_CLASS[size]; return (