Skip to content

Commit 3aa300c

Browse files
feat: halloween shenanigans
1 parent 47fb259 commit 3aa300c

File tree

21 files changed

+33
-54
lines changed

21 files changed

+33
-54
lines changed

examples/full/components/Loading.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type * as React from 'react'
2-
31
import { LoadingIcon } from './LoadingIcon'
42
import styles from './styles.module.css'
53

6-
export const Loading: React.FC = () => (
7-
<div className={styles.container}>
8-
<LoadingIcon />
9-
</div>
10-
)
4+
export function Loading() {
5+
return (
6+
<div className={styles.container}>
7+
<LoadingIcon />
8+
</div>
9+
)
10+
}

examples/full/components/LoadingIcon.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import cs from 'classnames'
2-
import * as React from 'react'
32

43
import styles from './styles.module.css'
54

6-
export const LoadingIcon = (props: any) => {
5+
export function LoadingIcon(props: any) {
76
const { className, ...rest } = props
87
return (
98
<svg

examples/full/components/NotionPage.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Link from 'next/link'
55
import { useRouter } from 'next/router'
66
import { type ExtendedRecordMap } from 'notion-types'
77
import { getPageTitle } from 'notion-utils'
8-
import * as React from 'react'
98
import { NotionRenderer } from 'react-notion-x'
109
import TweetEmbed from 'react-tweet-embed'
1110

@@ -75,11 +74,11 @@ const Modal = dynamic(
7574
}
7675
)
7776

78-
const Tweet = ({ id }: { id: string }) => {
77+
function Tweet({ id }: { id: string }) {
7978
return <TweetEmbed tweetId={id} />
8079
}
8180

82-
export const NotionPage = ({
81+
export function NotionPage({
8382
recordMap,
8483
previewImagesEnabled,
8584
rootPageId,
@@ -89,7 +88,7 @@ export const NotionPage = ({
8988
previewImagesEnabled?: boolean
9089
rootPageId?: string
9190
rootDomain?: string
92-
}) => {
91+
}) {
9392
const router = useRouter()
9493

9594
if (router.isFallback) {

examples/full/lib/notion.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@ export async function getPage(pageId: string): Promise<ExtendedRecordMap> {
3232
}
3333

3434
export async function search(params: SearchParams): Promise<SearchResults> {
35-
return notion.search(params)
35+
if ('search' in notion) {
36+
return notion.search(params)
37+
} else {
38+
throw new Error('Notion API does not support search')
39+
}
3640
}

examples/full/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
"next": "^15.0.2",
2020
"notion-client": "workspace:*",
2121
"notion-compat": "workspace:*",
22-
"notion-utils": "workspace:*",
2322
"notion-types": "workspace:*",
23+
"notion-utils": "workspace:*",
2424
"p-map": "^7.0.2",
2525
"p-memoize": "^7.1.1",
26+
"prismjs": "^1.27.0",
2627
"react": "^18.3.1",
2728
"react-dom": "^18.3.1",
2829
"react-notion-x": "workspace:*",

examples/full/pages/[pageId].tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { type ExtendedRecordMap } from 'notion-types'
22
import { getAllPagesInSpace } from 'notion-utils'
3-
import * as React from 'react'
43
import { defaultMapPageUrl } from 'react-notion-x'
54

65
import { NotionPage } from '../components/NotionPage'

examples/full/pages/_app.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import 'katex/dist/katex.min.css'
44
import 'prismjs/themes/prism-tomorrow.css'
55
// core styles shared by all of react-notion-x (required)
66
import 'react-notion-x/src/styles.css'
7-
// force push
7+
// app styles
88
import '../styles/globals.css'
99

10-
import * as React from 'react'
11-
1210
function MyApp({ Component, pageProps }) {
1311
return <Component {...pageProps} />
1412
}

examples/full/pages/_document.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Document, { Head, Html, Main, NextScript } from 'next/document'
2-
import * as React from 'react'
32

43
export default class MyDocument extends Document {
54
render() {

examples/full/pages/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type ExtendedRecordMap } from 'notion-types'
2-
import * as React from 'react'
32

43
import { NotionPage } from '../components/NotionPage'
54
import {

examples/full/tsconfig.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
{
22
"compilerOptions": {
3-
"target": "es2016",
4-
"lib": ["dom", "esnext"],
5-
"allowJs": false,
3+
"target": "ES2017",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
66
"skipLibCheck": true,
77
"strict": false,
88
"forceConsistentCasingInFileNames": true,
9-
"experimentalDecorators": true,
109
"noEmit": true,
1110
"esModuleInterop": true,
1211
"module": "esnext",
13-
"moduleResolution": "node",
12+
"moduleResolution": "bundler",
1413
"resolveJsonModule": true,
1514
"isolatedModules": true,
1615
"jsx": "preserve",

0 commit comments

Comments
 (0)