继续扩展共享异步状态壳

将 PlatformAsyncStatePanel 扩展到公共素材选择网格

将 PlatformAsyncStatePanel 扩展到视觉小说存档面板与账号安全子区块

将兑换码弹窗提交动作改为使用标准 profile modal footer

补充对应测试并更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
2026-06-11 04:11:32 +08:00
parent 7431b1b9a4
commit 7f8400fd3a
10 changed files with 220 additions and 115 deletions

View File

@@ -51,4 +51,25 @@ describe('PlatformProfileRewardCodeRedeemModal', () => {
screen.getByRole('button', { name: '兑换' }).hasAttribute('disabled'),
).toBe(true);
});
test('reuses the shared profile modal footer chrome for submit action', () => {
render(
<PlatformProfileRewardCodeRedeemModal
value="ab12"
isSubmitting={false}
error={null}
success={null}
onChange={vi.fn()}
onSubmit={vi.fn()}
onClose={vi.fn()}
/>,
);
const submitButton = screen.getByRole('button', { name: '兑换' });
const footer = submitButton.closest('div');
expect(footer?.className).toContain('border-t');
expect(footer?.className).toContain('pb-5');
expect(footer?.className).toContain('pt-0');
});
});

View File

@@ -33,6 +33,19 @@ export function PlatformProfileRewardCodeRedeemModal({
closeLabel="关闭兑换码"
panelClassName="platform-recharge-modal !max-w-sm rounded-[1.4rem]"
bodyClassName="space-y-3 px-5 py-5"
footerClassName="px-5 pb-5 pt-0"
footer={
<PlatformActionButton
surface="profile"
fullWidth
size="md"
className="disabled:opacity-50"
onClick={onSubmit}
disabled={isSubmitting || !value.trim()}
>
{isSubmitting ? '兑换中' : '兑换'}
</PlatformActionButton>
}
>
<PlatformTextField
value={value}
@@ -49,16 +62,6 @@ export function PlatformProfileRewardCodeRedeemModal({
aria-label="兑换码"
autoFocus
/>
<PlatformActionButton
surface="profile"
fullWidth
size="md"
className="disabled:opacity-50"
onClick={onSubmit}
disabled={isSubmitting || !value.trim()}
>
{isSubmitting ? '兑换中' : '兑换'}
</PlatformActionButton>
{error ? (
<PlatformStatusMessage
tone="error"