@@ -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 {
@@ -80,15 +86,6 @@ const Collection = dynamic(() =>
8086 ( m ) => m . Collection
8187 )
8288)
83- const Equation = dynamic ( ( ) =>
84- import ( 'react-notion-x/build/third-party/equation' ) . then ( ( m ) => m . Equation )
85- )
86- const Pdf = dynamic (
87- ( ) => import ( 'react-notion-x/build/third-party/pdf' ) . then ( ( m ) => m . Pdf ) ,
88- {
89- ssr : false
90- }
91- )
9289const Modal = dynamic (
9390 ( ) =>
9491 import ( 'react-notion-x/build/third-party/modal' ) . then ( ( m ) => {
@@ -152,11 +149,35 @@ const propertyTextValue = (
152149 return defaultFn ( )
153150}
154151
152+ const propertySelectValue = (
153+ { schema, value, key, pageHeader } ,
154+ defaultFn : ( ) => React . ReactNode
155+ ) => {
156+ value = normalizeTitle ( value )
157+
158+ if ( pageHeader && schema . type === 'multi_select' && value ) {
159+ return (
160+ < Link href = { `/tags/${ value } ` } key = { key } >
161+ < a > { defaultFn ( ) } </ a >
162+ </ Link >
163+ )
164+ }
165+
166+ return defaultFn ( )
167+ }
168+
169+ const HeroHeader = dynamic < { className ?: string } > (
170+ ( ) => import ( './HeroHeader' ) . then ( ( m ) => m . HeroHeader ) ,
171+ { ssr : false }
172+ )
173+
155174export function NotionPage ( {
156175 site,
157176 recordMap,
158177 error,
159- pageId
178+ pageId,
179+ tagsPage,
180+ propertyToFilterName
160181} : types . PageProps ) {
161182 const router = useRouter ( )
162183 const lite = useSearchParam ( 'lite' )
@@ -167,14 +188,13 @@ export function NotionPage({
167188 nextLink : Link ,
168189 Code,
169190 Collection,
170- Equation,
171- Pdf,
172191 Modal,
173192 Tweet,
174193 Header : NotionPageHeader ,
175194 propertyLastEditedTimeValue,
176195 propertyTextValue,
177- propertyDateValue
196+ propertyDateValue,
197+ propertySelectValue
178198 } ) ,
179199 [ ]
180200 )
@@ -199,6 +219,8 @@ export function NotionPage({
199219 // parsePageId(block?.id) === parsePageId(site?.rootNotionPageId)
200220 const isBlogPost =
201221 block ?. type === 'page' && block ?. parent_table === 'collection'
222+ const isBioPage =
223+ parsePageId ( block ?. id ) === parsePageId ( '8d0062776d0c4afca96eb1ace93a7538' )
202224
203225 const showTableOfContents = ! ! isBlogPost
204226 const minTableOfContentsItems = 3
@@ -212,6 +234,16 @@ export function NotionPage({
212234
213235 const footer = React . useMemo ( ( ) => < Footer /> , [ ] )
214236
237+ const pageCover = React . useMemo ( ( ) => {
238+ if ( isBioPage ) {
239+ return (
240+ < HeroHeader className = 'notion-page-cover-wrapper notion-page-cover-hero' />
241+ )
242+ } else {
243+ return null
244+ }
245+ } , [ isBioPage ] )
246+
215247 if ( router . isFallback ) {
216248 return < Loading />
217249 }
@@ -220,7 +252,9 @@ export function NotionPage({
220252 return < Page404 site = { site } pageId = { pageId } error = { error } />
221253 }
222254
223- const title = getBlockTitle ( block , recordMap ) || site . name
255+ const name = getBlockTitle ( block , recordMap ) || site . name
256+ const title =
257+ tagsPage && propertyToFilterName ? `${ propertyToFilterName } ${ name } ` : name
224258
225259 console . log ( 'notion page' , {
226260 isDev : config . isDev ,
@@ -269,7 +303,8 @@ export function NotionPage({
269303 < NotionRenderer
270304 bodyClassName = { cs (
271305 styles . notion ,
272- pageId === site . rootNotionPageId && 'index-page'
306+ pageId === site . rootNotionPageId && 'index-page' ,
307+ tagsPage && 'tags-page'
273308 ) }
274309 darkMode = { isDarkMode }
275310 components = { components }
@@ -284,11 +319,14 @@ export function NotionPage({
284319 defaultPageIcon = { config . defaultPageIcon }
285320 defaultPageCover = { config . defaultPageCover }
286321 defaultPageCoverPosition = { config . defaultPageCoverPosition }
322+ linkTableTitleProperties = { false }
287323 mapPageUrl = { siteMapPageUrl }
288324 mapImageUrl = { mapImageUrl }
289325 searchNotion = { config . isSearchEnabled ? searchNotion : null }
290326 pageAside = { pageAside }
291327 footer = { footer }
328+ pageTitle = { tagsPage && propertyToFilterName ? title : undefined }
329+ pageCover = { pageCover }
292330 />
293331
294332 < GitHubShareButton />
0 commit comments