mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-30 15:10:11 +00:00
feat(page): support tweet embed rendering
This commit is contained in:
@@ -4,6 +4,7 @@ import mediumZoom from '@fisch0920/medium-zoom'
|
||||
import React from 'react'
|
||||
import { isBrowser } from '@/lib/utils'
|
||||
import { Code } from 'react-notion-x/build/third-party/code'
|
||||
import TweetEmbed from 'react-tweet-embed'
|
||||
|
||||
import 'katex/dist/katex.min.css'
|
||||
import { mapImgUrl } from '@/lib/notion/mapImage'
|
||||
@@ -36,6 +37,10 @@ const Modal = dynamic(
|
||||
() => import('react-notion-x/build/third-party/modal').then((m) => m.Modal), { ssr: false }
|
||||
)
|
||||
|
||||
const Tweet = ({ id }) => {
|
||||
return <TweetEmbed tweetId={id} />
|
||||
}
|
||||
|
||||
const NotionPage = ({ post, className }) => {
|
||||
const zoom = isBrowser() && mediumZoom({
|
||||
container: '.notion-viewport',
|
||||
@@ -89,7 +94,8 @@ const NotionPage = ({ post, className }) => {
|
||||
Collection,
|
||||
Equation,
|
||||
Modal,
|
||||
Pdf
|
||||
Pdf,
|
||||
Tweet
|
||||
}} />
|
||||
|
||||
<PrismMac />
|
||||
|
||||
Reference in New Issue
Block a user