发布弹窗定色提到模块常量

GameDistributionPublishFormView.tsx:封面确认与截图预览两个 panelStyle 提取为模块级常量,不再每次渲染新建对象;按仓库约定保持内联样式,不新建 CSS 文件。
This commit is contained in:
2026-10-06 21:37:28 +08:00
parent d7ca19c598
commit 6487b52b31
@@ -13,6 +13,23 @@ import {
publicationVersionStatusLabel,
} from './useGameDistributionPublishForm';
/**
* 两个弹窗面板的定色。
*
* 仓库的样式约定是内联(Tailwind / JSX 内联样式),不为这种一次性定色新建 CSS 文件;提到模块级
* 常量是为了不再每次渲染都新建一个样式对象。`ThemedModal` 的默认背景会用内联样式写死,所以
* 这两处只能继续走 `panelStyle` 覆盖,不能只加 Tailwind 类。
*/
const COVER_CONFIRM_PANEL_STYLE = {
background: '#fffaf7',
color: '#4f362d',
} as const;
const SCREENSHOT_PREVIEW_PANEL_STYLE = {
background: '#1d1714',
color: '#fffaf7',
} as const;
/**
* 主行动按钮文案:先按发布绑定状态(检查中 / 不可用 / 更新)选路,再按打包与上传阶段选路。
*/
@@ -393,7 +410,7 @@ export function GameDistributionPublishFormView({
ariaLabel="确认生成游戏封面"
onClose={() => setCoverConfirmOpen(false)}
panelClassName="game-publish-progress-dialog game-publish-cover-confirm-dialog"
panelStyle={{ background: '#fffaf7', color: '#4f362d' }}
panelStyle={COVER_CONFIRM_PANEL_STYLE}
>
<div className="game-publish-progress-icon" aria-hidden="true">
✦
@@ -422,7 +439,7 @@ export function GameDistributionPublishFormView({
ariaLabel="截图预览"
onClose={() => setPreviewScreenshot(null)}
panelClassName="game-distribution-publish-panel__preview-dialog"
panelStyle={{ background: '#1d1714', color: '#fffaf7' }}
panelStyle={SCREENSHOT_PREVIEW_PANEL_STYLE}
>
{previewScreenshot?.previewUrl ? (
<img