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 ? (