Skip to content

Commit 9b38e09

Browse files
committed
fix: set w-full first
Signed-off-by: Innei <[email protected]>
1 parent 0aed3f7 commit 9b38e09

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/ui/link-card/LinkCard.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const LinkCard = (props: LinkCardProps) => {
4444
}
4545

4646
type CardState = {
47-
title: ReactNode
47+
title?: ReactNode
4848
desc?: ReactNode
4949
image?: string
5050
color?: string
@@ -431,6 +431,9 @@ const fetchTheMovieDBData: FetchObject = {
431431
async fetch(id, setCardInfo, setFullUrl) {
432432
const [type, realId] = id.split('/')
433433

434+
setCardInfo({
435+
classNames: { cardRoot: '!w-full' },
436+
})
434437
const json = await fetch(`/api/tmdb/${type}/${realId}?language=zh-CN`)
435438
.then((r) => r.json())
436439
.catch((err) => {
@@ -472,6 +475,6 @@ const fetchTheMovieDBData: FetchObject = {
472475
cardRoot: '!w-full',
473476
},
474477
})
475-
setFullUrl(json.homepage)
478+
json.homepage && setFullUrl(json.homepage)
476479
},
477480
}

0 commit comments

Comments
 (0)