继续扩展共享异步状态壳
将 PlatformAsyncStatePanel 扩展到公共素材选择网格 将 PlatformAsyncStatePanel 扩展到视觉小说存档面板与账号安全子区块 将兑换码弹窗提交动作改为使用标准 profile modal footer 补充对应测试并更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user