收口推荐卡与作品卡图标动作按钮

推荐运行态点赞分享改造按钮复用 PlatformIconButton 并保留拖拽隔离
创作中心公开作品卡分享快按钮复用 PlatformIconButton
补充回归测试并更新 PlatformUiKit 收口文档与共享决策
This commit is contained in:
2026-06-10 18:15:58 +08:00
parent 1841eac0e1
commit 17cf65a1a3
6 changed files with 55 additions and 28 deletions

View File

@@ -1139,7 +1139,13 @@ test('creation hub published share icon is shown directly on the card header', (
/>,
);
expect(screen.getByRole('button', { name: '分享' })).toBeTruthy();
const shareButton = screen.getByRole('button', { name: '分享' });
expect(shareButton).toBeTruthy();
expect(shareButton.className).toContain('platform-icon-button');
expect(shareButton.className).toContain(
'creation-work-card__quick-action-button',
);
expect(screen.queryByRole('button', { name: '删除' })).toBeNull();
});

View File

@@ -19,6 +19,7 @@ import {
} from 'react';
import { PlatformActionButton } from '../common/PlatformActionButton';
import { PlatformIconButton } from '../common/PlatformIconButton';
import { PlatformPillBadge } from '../common/PlatformPillBadge';
import { CustomWorldCoverArtwork } from '../CustomWorldCoverArtwork';
import {
@@ -651,8 +652,9 @@ export function CustomWorldWorkCard({
</div>
{canUseShareAction ? (
<div className="creation-work-card__quick-actions">
<button
type="button"
<PlatformIconButton
label="分享"
icon={<Share2 aria-hidden="true" className="h-4 w-4" />}
onClick={(event) => {
event.stopPropagation();
suppressOpenRef.current = false;
@@ -669,11 +671,8 @@ export function CustomWorldWorkCard({
event.stopPropagation();
}}
title="分享作品"
aria-label="分享"
className="creation-work-card__quick-action-button"
>
<Share2 aria-hidden="true" className="h-4 w-4" />
</button>
/>
</div>
) : null}
</div>