Skip to content

Commit

Permalink
fix: add cover for preview modal
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Dec 25, 2023
1 parent fcc5896 commit 4000079
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/widgets/peek/NotePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -52,10 +54,13 @@ export const NotePreview: FC<NotePreviewProps> = (props) => {
const overrideAtom = useMemo(() => atom(null! as NoteWrappedPayload), [])
if (isLoading) return <Loading className="w-full" useDefaultLoadingText />
if (!data) return null
const note = data.data
return (
<CurrentNoteDataAtomProvider overrideAtom={overrideAtom}>
<CurrentNoteDataProvider data={data} />
{!!note.id && <AckRead id={note.id} type="note" />}
<Paper>
{note.meta?.cover && <NoteHeadCover image={note.meta.cover} />}
<IndentArticleContainer>
<header>
<NoteTitle />
Expand Down
2 changes: 2 additions & 0 deletions src/components/widgets/peek/PostPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -54,6 +55,7 @@ export const PostPreview: FC<PostPreviewProps> = (props) => {
return (
<CurrentPostDataAtomProvider overrideAtom={overrideAtom}>
<CurrentPostDataProvider data={data} />
{!!data.id && <AckRead id={data.id} type="post" />}
<Paper>
<article className="prose relative w-full min-w-0">
<header className="mb-8">
Expand Down

1 comment on commit 4000079

@vercel
Copy link

@vercel vercel bot commented on 4000079 Dec 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-git-main-innei.vercel.app
shiro-innei.vercel.app
springtide.vercel.app
innei.in

Please sign in to comment.