@@ -4,7 +4,13 @@ import Image from 'next/legacy/image'
44import Link from 'next/link'
55import { useRouter } from 'next/router'
66import { type PageBlock } from 'notion-types'
7- import { formatDate , getBlockTitle , getPageProperty } from 'notion-utils'
7+ import {
8+ formatDate ,
9+ getBlockTitle ,
10+ getPageProperty ,
11+ normalizeTitle ,
12+ parsePageId
13+ } from 'notion-utils'
814import * as React from 'react'
915import BodyClassName from 'react-body-classname'
1016import {
@@ -111,15 +117,6 @@ const Collection = dynamic(() =>
111117 ( m ) => m . Collection
112118 )
113119)
114- const Equation = dynamic ( ( ) =>
115- import ( 'react-notion-x/build/third-party/equation' ) . then ( ( m ) => m . Equation )
116- )
117- const Pdf = dynamic (
118- ( ) => import ( 'react-notion-x/build/third-party/pdf' ) . then ( ( m ) => m . Pdf ) ,
119- {
120- ssr : false
121- }
122- )
123120const Modal = dynamic (
124121 ( ) =>
125122 import ( 'react-notion-x/build/third-party/modal' ) . then ( ( m ) => {
@@ -183,11 +180,35 @@ const propertyTextValue = (
183180 return defaultFn ( )
184181}
185182
183+ const propertySelectValue = (
184+ { schema, value, key, pageHeader } : any ,
185+ defaultFn : ( ) => React . ReactNode
186+ ) => {
187+ value = normalizeTitle ( value )
188+
189+ if ( pageHeader && schema . type === 'multi_select' && value ) {
190+ return (
191+ < Link href = { `/tags/${ value } ` } key = { key } legacyBehavior >
192+ < a > { defaultFn ( ) } </ a >
193+ </ Link >
194+ )
195+ }
196+
197+ return defaultFn ( )
198+ }
199+
200+ const HeroHeader = dynamic < { className ?: string } > (
201+ ( ) => import ( './HeroHeader' ) . then ( ( m ) => m . HeroHeader ) ,
202+ { ssr : false }
203+ )
204+
186205export function NotionPage ( {
187206 site,
188207 recordMap,
189208 error,
190- pageId
209+ pageId,
210+ tagsPage,
211+ propertyToFilterName
191212} : types . PageProps ) {
192213 const router = useRouter ( )
193214 const lite = useSearchParam ( 'lite' )
@@ -198,14 +219,13 @@ export function NotionPage({
198219 nextLink : Link ,
199220 Code,
200221 Collection,
201- Equation,
202- Pdf,
203222 Modal,
204223 Tweet,
205224 Header : NotionPageHeader ,
206225 propertyLastEditedTimeValue,
207226 propertyTextValue,
208- propertyDateValue
227+ propertyDateValue,
228+ propertySelectValue
209229 } ) ,
210230 [ ]
211231 )
@@ -230,6 +250,8 @@ export function NotionPage({
230250 // parsePageId(block?.id) === parsePageId(site?.rootNotionPageId)
231251 const isBlogPost =
232252 block ?. type === 'page' && block ?. parent_table === 'collection'
253+ const isBioPage =
254+ parsePageId ( block ?. id ) === parsePageId ( '8d0062776d0c4afca96eb1ace93a7538' )
233255
234256 const showTableOfContents = ! ! isBlogPost
235257 const minTableOfContentsItems = 3
@@ -247,6 +269,16 @@ export function NotionPage({
247269
248270 const footer = React . useMemo ( ( ) => < Footer /> , [ ] )
249271
272+ const pageCover = React . useMemo ( ( ) => {
273+ if ( isBioPage ) {
274+ return (
275+ < HeroHeader className = 'notion-page-cover-wrapper notion-page-cover-hero' />
276+ )
277+ } else {
278+ return null
279+ }
280+ } , [ isBioPage ] )
281+
250282 if ( router . isFallback ) {
251283 return < Loading />
252284 }
@@ -255,7 +287,9 @@ export function NotionPage({
255287 return < Page404 site = { site } pageId = { pageId } error = { error } />
256288 }
257289
258- const title = getBlockTitle ( block , recordMap ) || site . name
290+ const name = getBlockTitle ( block , recordMap ) || site . name
291+ const title =
292+ tagsPage && propertyToFilterName ? `${ propertyToFilterName } ${ name } ` : name
259293
260294 console . log ( 'notion page' , {
261295 isDev : config . isDev ,
@@ -305,7 +339,8 @@ export function NotionPage({
305339 < NotionRenderer
306340 bodyClassName = { cs (
307341 styles . notion ,
308- pageId === site . rootNotionPageId && 'index-page'
342+ pageId === site . rootNotionPageId && 'index-page' ,
343+ tagsPage && 'tags-page'
309344 ) }
310345 darkMode = { isDarkMode }
311346 components = { components }
@@ -320,11 +355,14 @@ export function NotionPage({
320355 defaultPageIcon = { config . defaultPageIcon }
321356 defaultPageCover = { config . defaultPageCover }
322357 defaultPageCoverPosition = { config . defaultPageCoverPosition }
358+ linkTableTitleProperties = { false }
323359 mapPageUrl = { siteMapPageUrl }
324360 mapImageUrl = { mapImageUrl }
325361 searchNotion = { config . isSearchEnabled ? searchNotion : undefined }
326362 pageAside = { pageAside }
327363 footer = { footer }
364+ pageTitle = { tagsPage && propertyToFilterName ? title : undefined }
365+ pageCover = { pageCover }
328366 />
329367
330368 < GitHubShareButton />
0 commit comments