Skip to content

Commit

Permalink
Fix for blank blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeraze committed Nov 19, 2022
1 parent 8cbd304 commit 150a16e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 10 additions & 13 deletions components/NotionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,6 @@ export const NotionPage: React.FC<types.PageProps> = ({
)

const footer = React.useMemo(() => <Footer />, [])
const canonicalPageUrl =
!config.isDev && getCanonicalPageUrl(site, recordMap)(pageId)
const title = getBlockTitle(block, recordMap) || site.name

const disqus = React.useMemo(() => <DiscussionEmbed
shortname='yerazesdomain'
config={ {
url: canonicalPageUrl,
title: title
} }
/>, [canonicalPageUrl, title])

if (router.isFallback) {
return <Loading />
Expand All @@ -224,6 +213,9 @@ export const NotionPage: React.FC<types.PageProps> = ({
return <Page404 site={site} pageId={pageId} error={error} />
}

const canonicalPageUrl =
!config.isDev && getCanonicalPageUrl(site, recordMap)(pageId)
const title = getBlockTitle(block, recordMap) || site.name

console.log('notion page', {
isDev: config.isDev,
Expand All @@ -241,8 +233,6 @@ export const NotionPage: React.FC<types.PageProps> = ({
g.block = block
}



const socialImage = mapImageUrl(
getPageProperty<string>('Social Image', block, recordMap) ||
(block as PageBlock).format?.page_cover ||
Expand All @@ -255,6 +245,13 @@ export const NotionPage: React.FC<types.PageProps> = ({
config.description


const disqus =<DiscussionEmbed
shortname='yerazesdomain'
config={ {
url: canonicalPageUrl,
title: title
} }
/>

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ body {
}


.disqusComments {
#disqus_thread {
width: 100%;
}

1 comment on commit 150a16e

@vercel
Copy link

@vercel vercel bot commented on 150a16e Nov 19, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.