diff --git a/src/components/creation-home/CreationLandingView.test.tsx b/src/components/creation-home/CreationLandingView.test.tsx index b2333be8c..970e66e09 100644 --- a/src/components/creation-home/CreationLandingView.test.tsx +++ b/src/components/creation-home/CreationLandingView.test.tsx @@ -442,6 +442,51 @@ describe('CreationLandingView', () => { ).toBeTruthy(); }); + it('does not show a like action in the featured asset preview modal', async () => { + const user = userEvent.setup(); + listEditorProjectsMock.mockResolvedValueOnce(projectItems); + listPublicEditorProjectResourcesMock.mockResolvedValueOnce([ + { + resourceId: 'resource-character', + projectId: 'project-newest', + showcaseId: 'showcase-character', + label: '角色英雄', + imageSrc: 'data:image/png;base64,character', + width: 512, + height: 512, + sourceType: 'generated', + prompt: 'character hero prompt', + actualPrompt: null, + model: 'character-model', + provider: 'provider', + taskId: 'task-1', + showcaseCategory: 'characters', + likeCount: 3, + generationCostMudPoints: 20, + }, + ]); + + renderCreationLanding(); + await user.click(screen.getByRole('tab', { name: '角色' })); + + const likeButton = await screen.findByRole('button', { + name: '点赞:角色英雄', + }); + const assetCard = likeButton.closest( + '.creation-landing__asset-card', + ) as HTMLElement; + await user.click( + assetCard.querySelector( + '.creation-landing__asset-card-open', + ) as HTMLElement, + ); + + const dialog = await screen.findByRole('dialog', { name: '角色英雄' }); + expect(within(dialog).getByText('赞')).toBeTruthy(); + expect(within(dialog).getByText('3')).toBeTruthy(); + expect(within(dialog).queryByRole('button', { name: /点赞/ })).toBeNull(); + }); + it('opens a fullscreen asset preview modal with thumbnail navigation', async () => { const user = userEvent.setup(); listEditorProjectsMock.mockResolvedValueOnce(projectItems); diff --git a/src/components/creation-home/CreationLandingView.tsx b/src/components/creation-home/CreationLandingView.tsx index ea7b08279..d4c989cdb 100644 --- a/src/components/creation-home/CreationLandingView.tsx +++ b/src/components/creation-home/CreationLandingView.tsx @@ -322,18 +322,12 @@ function ShowcaseBundlePreview({ item }: { item: ShowcaseAssetItem }) { function CreationShowcaseModal({ item, activeIndex, - isLiked, - isLikePending, onSelectIndex, - onToggleLike, onClose, }: { item: ShowcaseAssetItem | null; activeIndex: number; - isLiked: boolean; - isLikePending: boolean; onSelectIndex: (index: number) => void; - onToggleLike: (item: ShowcaseAssetItem) => void; onClose: () => void; }) { const safeActiveIndex = item @@ -389,25 +383,6 @@ function CreationShowcaseModal({ ) : null} - {item.showcaseId ? ( - onToggleLike(item)} - > - - - {isLikePending ? '处理中' : isLiked ? '已点赞' : '点赞'} - - - ) : null}
setSelectedShowcaseItem(null)} />