From 688d3b103ad3645c30c315712b83db0d5ca44d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 30 Sep 2026 16:18:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E6=B8=B8=E6=88=8F=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=A1=B5=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化工具栏布局 - 属性化客户端入口组件,支持按钮文案、样式及窄屏选项配置 --- .../creation-home/ClientDownloadEntry.tsx | 48 +++++++++++++++---- .../game-distribution/GamePublishPage.tsx | 10 ++-- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/components/creation-home/ClientDownloadEntry.tsx b/src/components/creation-home/ClientDownloadEntry.tsx index c85742755..6d228ec92 100644 --- a/src/components/creation-home/ClientDownloadEntry.tsx +++ b/src/components/creation-home/ClientDownloadEntry.tsx @@ -1,4 +1,8 @@ -import { getPlatformActionButtonClassName } from '@genarrative/shared/components'; +import { + getPlatformActionButtonClassName, + type PlatformActionButtonSize, + type PlatformActionButtonTone, +} from '@genarrative/shared/components'; import { Download, Monitor } from 'lucide-react'; import { useEffect, useState } from 'react'; @@ -10,6 +14,16 @@ import { UnifiedModal } from '../common/UnifiedModal'; const DOWNLOAD_ERROR = '暂时无法获取最新版本,请稍后重试'; +type ClientDownloadEntryProps = { + /** 按钮文案,默认「下载客户端」。 */ + label?: string; + tone?: PlatformActionButtonTone; + size?: PlatformActionButtonSize; + /** 窄屏只留图标:平台顶栏默认开启,页面级引导入口传 false 保留完整文案。 */ + iconOnlyOnNarrowScreens?: boolean; + className?: string; +}; + type DownloadState = | { status: 'loading' } | { status: 'ready'; release: ClientDownloadResponse } @@ -22,7 +36,13 @@ function downloadLabel(download: ClientDownloadResponse['downloads'][number]) { return `macOS(${download.architecture === 'aarch64' ? 'Apple Silicon' : 'Intel'})`; } -export function ClientDownloadEntry() { +export function ClientDownloadEntry({ + label = '下载客户端', + tone = 'secondary', + size = 'sm', + iconOnlyOnNarrowScreens = true, + className, +}: ClientDownloadEntryProps = {}) { const [open, setOpen] = useState(false); const [attempt, setAttempt] = useState(0); const [state, setState] = useState({ status: 'loading' }); @@ -72,19 +92,31 @@ export function ClientDownloadEntry() { return ( <> { setState({ status: 'loading' }); setOpen(true); }} > 返回 -
-
+
+
{updateGameId ? '发布新版本' : '发布游戏'} -

+

{updateGameId ? updateContext ? `为《${updateContext.title}》发布 v${updateContext.versionNumber + 1}` @@ -724,6 +725,9 @@ export function GamePublishPage({ : '上传可在线游玩的网页游戏'}

+ {!updateGameId ? ( + + ) : null}
{error ? (