Skip to content

Commit

Permalink
fix: update markdown-to-jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Aug 2, 2023
1 parent 17f3e1c commit a8eb26f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"immer": "^10.0.2",
"jotai": "2.2.2",
"js-cookie": "3.0.5",
"markdown-to-jsx": "npm:@innei/markdown-to-jsx@7.1.3-beta.2",
"markdown-to-jsx": "npm:@innei/markdown-to-jsx@7.2.1-beta.0",
"medium-zoom": "1.0.8",
"mermaid": "10.3.0",
"next": "13.4.12",
Expand Down
17 changes: 6 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/notes/[id]/pageImpl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
NoteFooterNavigationBarForMobile,
NoteTopic,
} from '~/components/widgets/note'
import { NoteBanner } from '~/components/widgets/note/NoteBanner'
import { NoteRootBanner } from '~/components/widgets/note/NoteBanner'
import { ArticleRightAside } from '~/components/widgets/shared/ArticleRightAside'
import { BanCopyWrapper } from '~/components/widgets/shared/BanCopyWrapper'
import { ReadIndicatorForMobile } from '~/components/widgets/shared/ReadIndicator'
Expand Down Expand Up @@ -52,7 +52,7 @@ const NotePage = function (props: NoteModel) {
</ClientOnly>
</span>
<div className="ml-[-1.25em] mr-[-1.25em] mt-8 text-sm lg:ml-[calc(-3em)] lg:mr-[calc(-3em)]">
<NoteBanner />
<NoteRootBanner />
</div>
</header>

Expand Down
4 changes: 2 additions & 2 deletions src/app/preview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { simpleCamelcaseKeys } from '@mx-space/api-client'
import { previewDataAtom } from '~/atoms/preview'
import { ErrorBoundary } from '~/components/common/ErrorBoundary'
import { Paper } from '~/components/layout/container/Paper'
import { NoteBanner, NoteMetaBar } from '~/components/widgets/note'
import { NoteMetaBar, NoteRootBanner } from '~/components/widgets/note'
import { PageActionAside } from '~/components/widgets/page/PageActionAside'
import { PostActionAside } from '~/components/widgets/post'
import { ArticleRightAside } from '~/components/widgets/shared/ArticleRightAside'
Expand Down Expand Up @@ -184,7 +184,7 @@ const NotePreview = () => {
<NoteMetaBar />
</span>
<div className="ml-[-1.25em] mr-[-1.25em] mt-8 text-sm lg:ml-[calc(-3em)] lg:mr-[calc(-3em)]">
<NoteBanner />
<NoteRootBanner />
</div>
</header>

Expand Down
13 changes: 12 additions & 1 deletion src/components/widgets/note/NoteBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client'

import type { FC } from 'react'

import { clsxm } from '~/lib/helper'
import { useCurrentNoteDataSelector } from '~/providers/note/CurrentNoteDataProvider'

Expand Down Expand Up @@ -39,10 +41,19 @@ const useNoteBanner = () => {
return banner
}

export const NoteBanner = () => {
export const NoteRootBanner = () => {
const banner = useNoteBanner()

if (!banner) return null

return <NoteBanner {...banner} />
}

export const NoteBanner: FC<{
style?: any
className: string
message: string
}> = (banner) => {
return (
<div
className={clsxm('flex justify-center p-4 leading-8', banner.className)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/peek/NotePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { WrappedElementProvider } from '~/providers/shared/WrappedElementProvider'
import { queries } from '~/queries/definition'

import { NoteBanner, NoteHideIfSecret, NoteMetaBar } from '../note'
import { NoteHideIfSecret, NoteMetaBar, NoteRootBanner } from '../note'
import { BanCopyWrapper } from '../shared/BanCopyWrapper'
import { XLogSummaryForNote } from '../xlog'

Expand Down Expand Up @@ -53,7 +53,7 @@ export const NotePreview: FC<NotePreviewProps> = (props) => {
</ClientOnly>
</span>
<div className="ml-[-1.25em] mr-[-1.25em] mt-8 text-sm lg:ml-[calc(-3em)] lg:mr-[calc(-3em)]">
<NoteBanner />
<NoteRootBanner />
</div>
</header>

Expand Down
6 changes: 6 additions & 0 deletions src/styles/tailwindcss.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit a8eb26f

@vercel
Copy link

@vercel vercel bot commented on a8eb26f Aug 2, 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
springtide.vercel.app
innei.in
shiro-innei.vercel.app

Please sign in to comment.