feat: fixes and styling

This commit is contained in:
Travis Fischer
2021-01-15 15:44:34 -05:00
parent 32b845af2b
commit 052405e8c8
7 changed files with 29 additions and 33 deletions

View File

@@ -10,7 +10,9 @@ const notion = new NotionAPI({
export default notion
export async function getPage(pageId: string): Promise<ExtendedRecordMap> {
const recordMap = await notion.getPage(pageId)
const recordMap = await notion.getPage(pageId, {
fetchParents: false
})
const blockIds = Object.keys(recordMap.block)
const imageUrls: string[] = blockIds

View File

@@ -50,14 +50,6 @@ export interface SiteMap {
pageIds: string[]
}
export interface Breadcrumb {
block: Block
active: boolean
pageId: string
title: string
icon: string
}
export interface PreviewImage {
url: string
originalWidth: number

View File

@@ -33,15 +33,15 @@
"is-url-superb": "^5.0.0",
"lqip-modern": "^1.1.3",
"next": "^10.0.6-canary.2",
"notion-client": "^3.0.0",
"notion-client": "^3.0.1",
"notion-types": "^3.0.0",
"notion-utils": "^3.0.0",
"notion-utils": "^3.0.1",
"p-map": "^4.0.0",
"p-memoize": "^4.0.0",
"react": "17.0.1",
"react-body-classname": "^1.3.1",
"react-dom": "17.0.1",
"react-notion-x": "^3.0.0",
"react-notion-x": "^3.0.1",
"react-use": "^15.3.3"
},
"devDependencies": {

View File

@@ -13,8 +13,10 @@ import 'rc-dropdown/assets/index.css'
// used for rendering equations (optional)
// import 'katex/dist/katex.min.css'
import * as React from 'react'
import { useEffect } from 'react'
// global style overrides for notion
import 'styles/notion.css'
import React from 'react'
import { useRouter } from 'next/router'
import { bootstrap } from 'lib/bootstrap-client'
import { fathomId, fathomConfig } from 'lib/config'
@@ -27,7 +29,7 @@ if (typeof window !== 'undefined') {
export default function App({ Component, pageProps }) {
const router = useRouter()
useEffect(() => {
React.useEffect(() => {
if (fathomId) {
Fathom.load(fathomId, fathomConfig)

View File

@@ -18,7 +18,3 @@ html {
body {
overflow-y: hidden;
}
.notion-page {
margin: 0 12px;
}

4
styles/notion.css Normal file
View File

@@ -0,0 +1,4 @@
.notion-page {
margin: 0 12px;
width: 728px;
}

View File

@@ -4297,14 +4297,14 @@ normalize-url@^4.1.0:
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129"
integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==
notion-client@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/notion-client/-/notion-client-3.0.0.tgz#46718092620874f5b11972debf36244951fa017a"
integrity sha512-ZDyh2+P47mkTAe92COhsC/smiKrC5wuBOjPU6PsGU9hjqgM1ZMoQ4DJsoe88Bn8ZcU3Nr5idiJluXKwLdjfYxA==
notion-client@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/notion-client/-/notion-client-3.0.1.tgz#3e446928a3744bb4a8118a8773b06184d9739011"
integrity sha512-GBzSUIoAxtGUp0AkvCh/ucKy6bXwHu/BsB7ri+L8W3iGJQ0DVQgvNJODMNZie/fkWwFVdlYy5Qzl87D06JGDnw==
dependencies:
node-fetch "^2.6.1"
notion-types "^3.0.0"
notion-utils "^3.0.0"
notion-utils "^3.0.1"
p-map "^4.0.0"
notion-types@^3.0.0:
@@ -4312,10 +4312,10 @@ notion-types@^3.0.0:
resolved "https://registry.yarnpkg.com/notion-types/-/notion-types-3.0.0.tgz#498a018338556eff71d8ea6d104992525573191f"
integrity sha512-Wq/xUmf9YAZI0riZrDf5oL58N+4J4ydHqguMkr6V1YZsXnLUEYlV7GUsCzhYwehOBjGKV4ocD7FiWOSi54IUOw==
notion-utils@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/notion-utils/-/notion-utils-3.0.0.tgz#f2eb1734f50aa70ed30ed82023ec0f5a0bb41255"
integrity sha512-r3ohJcwAWvr4DR/MKQf5nvlpx8uHgC17dWtBAtyk+xxyDesDltPQ+nT7B5YWwGKdUFKiad1HMqL1yGmM8+TGAw==
notion-utils@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/notion-utils/-/notion-utils-3.0.1.tgz#31b4e5eeb42588453019330c11e523d79f63b4cf"
integrity sha512-sXgRWkxN2BscU6wPVrYApOnNqiA4JvUpt0MfRlV5xUYmw/9xqiDYmiipN/BtUM7TkAx6p96kXFk3xm4ZU06GPg==
dependencies:
notion-types "^3.0.0"
p-queue "^6.6.1"
@@ -5109,10 +5109,10 @@ react-modal@^3.11.2:
react-lifecycles-compat "^3.0.0"
warning "^4.0.3"
react-notion-x@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/react-notion-x/-/react-notion-x-3.0.0.tgz#210e5e93980cf57c63babf9205afd2003e6a0390"
integrity sha512-do/djGJuYHOEWjg1kAE0qNkYhjJPQpRtfgeyLtFsokAITlaeYxVLOrl5LLVC5GybFbvydqy3ZwkwWOKA7g+1Cw==
react-notion-x@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/react-notion-x/-/react-notion-x-3.0.1.tgz#db0fe7de8398f4e67e830ffad17533ae2dc15aab"
integrity sha512-sgNzWQNEzX+nI3nDIkMASDXHaPPSrlvvWXTvN8H/LgG39tm+3CTICaSmbm+ZYC+HNEwPwlXGXFG6AtvM+nWXCw==
dependencies:
"@matejmazur/react-katex" "^3.1.3"
date-fns "^2.15.0"
@@ -5122,7 +5122,7 @@ react-notion-x@^3.0.0:
lodash.throttle "^4.1.1"
medium-zoom "^1.0.6"
notion-types "^3.0.0"
notion-utils "^3.0.0"
notion-utils "^3.0.1"
prismjs "^1.20.0"
rc-dropdown "^3.1.2"
rc-menu "^8.5.2"