截图按钮文案抽成函数并跟常量对齐
GameDistributionPublishFormView.tsx:新增 resolveScreenshotPickLabel,替掉嵌套三元并把「截图已满 6 张」改成 MAX_AGC_GAME_SCREENSHOTS。
This commit is contained in:
+16
-5
@@ -55,6 +55,18 @@ function resolvePublicationStatusLabel(
|
||||
}
|
||||
}
|
||||
|
||||
/** 截图选择按钮的文案:满 / 上传中 / 可添加三态,上限跟着常量走。 */
|
||||
function resolveScreenshotPickLabel(state: {
|
||||
activeScreenshotCount: number;
|
||||
screenshotsUploading: boolean;
|
||||
}) {
|
||||
if (state.activeScreenshotCount >= MAX_AGC_GAME_SCREENSHOTS) {
|
||||
return `截图已满 ${MAX_AGC_GAME_SCREENSHOTS} 张`;
|
||||
}
|
||||
if (state.screenshotsUploading) return '截图上传中…';
|
||||
return '添加截图';
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布资料表单的表现层(工作台内联形态)。
|
||||
*
|
||||
@@ -289,11 +301,10 @@ export function GameDistributionPublishFormView({
|
||||
}}
|
||||
/>
|
||||
<span className="game-distribution-publish-panel__pick">
|
||||
{activeScreenshotCount >= MAX_AGC_GAME_SCREENSHOTS
|
||||
? '截图已满 6 张'
|
||||
: screenshotsUploading
|
||||
? '截图上传中…'
|
||||
: '添加截图'}
|
||||
{resolveScreenshotPickLabel({
|
||||
activeScreenshotCount,
|
||||
screenshotsUploading,
|
||||
})}
|
||||
</span>
|
||||
</span>
|
||||
<span className="game-distribution-publish-panel__hint">
|
||||
|
||||
Reference in New Issue
Block a user