From 40000792303a557bcf3740374fe847b28d2f2c42 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 25 Dec 2023 17:28:22 +0800 Subject: [PATCH] fix: add cover for preview modal Signed-off-by: Innei --- src/components/widgets/peek/NotePreview.tsx | 5 +++++ src/components/widgets/peek/PostPreview.tsx | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/components/widgets/peek/NotePreview.tsx b/src/components/widgets/peek/NotePreview.tsx index 4cc48ba797..18f9080118 100644 --- a/src/components/widgets/peek/NotePreview.tsx +++ b/src/components/widgets/peek/NotePreview.tsx @@ -11,6 +11,7 @@ import { NoteMarkdownImageRecordProvider, NoteTitle, } from '~/app/notes/[id]/pageExtra' +import { AckRead } from '~/components/common/AckRead' import { ClientOnly } from '~/components/common/ClientOnly' import { Paper } from '~/components/layout/container/Paper' import { Loading } from '~/components/ui/loading' @@ -22,6 +23,7 @@ import { WrappedElementProvider } from '~/providers/shared/WrappedElementProvide import { queries } from '~/queries/definition' import { NoteHideIfSecret, NoteMetaBar, NoteRootBanner } from '../note' +import { NoteHeadCover } from '../note/NoteHeadCover' import { BanCopyWrapper } from '../shared/BanCopyWrapper' import { XLogSummary } from '../xlog' import { getCidForBaseModel } from '../xlog/utils' @@ -52,10 +54,13 @@ export const NotePreview: FC = (props) => { const overrideAtom = useMemo(() => atom(null! as NoteWrappedPayload), []) if (isLoading) return if (!data) return null + const note = data.data return ( + {!!note.id && } + {note.meta?.cover && }
diff --git a/src/components/widgets/peek/PostPreview.tsx b/src/components/widgets/peek/PostPreview.tsx index 49d98e44d9..a222381843 100644 --- a/src/components/widgets/peek/PostPreview.tsx +++ b/src/components/widgets/peek/PostPreview.tsx @@ -10,6 +10,7 @@ import { PostMarkdownImageRecordProvider, PostMetaBarInternal, } from '~/app/posts/(post-detail)/[category]/[slug]/pageExtra' +import { AckRead } from '~/components/common/AckRead' import { Paper } from '~/components/layout/container/Paper' import { Loading } from '~/components/ui/loading' import { @@ -54,6 +55,7 @@ export const PostPreview: FC = (props) => { return ( + {!!data.id && }