11// import { Client } from 'notion-to-utils';
22import React , { useEffect , useState , useMemo , useCallback } from 'react' ;
3- import { ThemeProvider } from 'styled-components' ;
4- import { Container } from './styles' ;
3+ import { container } from './styles.css' ;
54
6- import { lightTheme , darkTheme , Theme } from '../../styles/theme' ;
75import { NotionBlock } from '../../types' ;
86import testData from '../../constants/test.json' ;
97import { useKeyboardNavigation } from '../../hooks/useKeyboardNavigation' ;
10- import { BlockRenderer } from './components/Block' ;
11- import { List , ListBlocksRenderer } from './components/List' ;
8+ import { darkTheme , lightTheme } from '../../styles/theme.css' ;
9+ // import { BlockRenderer } from './components/Block';
10+ // import { List, ListBlocksRenderer } from './components/List';
1211
1312const notion = {
1413 getPageBlocks : async ( ) => {
@@ -66,21 +65,22 @@ export const Renderer: React.FC<Props> = React.memo(
6665 block . type === 'bulleted_list_item' &&
6766 ( i === 0 || blocks [ i - 1 ] ?. type !== 'bulleted_list_item' )
6867 ) {
69- result . push (
70- < List
71- as = "ul"
72- type = "bulleted"
73- role = "list"
74- aria-label = "Bulleted list"
75- key = { block . id }
76- >
77- < ListBlocksRenderer
78- blocks = { blocks }
79- startIndex = { i }
80- type = "bulleted"
81- />
82- </ List >
83- ) ;
68+ result
69+ . push
70+ // <List
71+ // as="ul"
72+ // type="bulleted"
73+ // role="list"
74+ // aria-label="Bulleted list"
75+ // key={block.id}
76+ // >
77+ // <ListBlocksRenderer
78+ // blocks={blocks}
79+ // startIndex={i}
80+ // type="bulleted"
81+ // />
82+ // </List>
83+ ( ) ;
8484 while (
8585 i + 1 < blocks . length &&
8686 blocks [ i + 1 ] &&
@@ -92,21 +92,22 @@ export const Renderer: React.FC<Props> = React.memo(
9292 block . type === 'numbered_list_item' &&
9393 ( i === 0 || blocks [ i - 1 ] ?. type !== 'numbered_list_item' )
9494 ) {
95- result . push (
96- < List
97- as = "ol"
98- type = "1"
99- role = "list"
100- aria-label = "Numbered list"
101- key = { block . id }
102- >
103- < ListBlocksRenderer
104- blocks = { blocks }
105- startIndex = { i }
106- type = "numbered"
107- />
108- </ List >
109- ) ;
95+ result
96+ . push
97+ // <List
98+ // as="ol"
99+ // type="1"
100+ // role="list"
101+ // aria-label="Numbered list"
102+ // key={block.id}
103+ // >
104+ // <ListBlocksRenderer
105+ // blocks={blocks}
106+ // startIndex={i}
107+ // type="numbered"
108+ // />
109+ // </List>
110+ ( ) ;
110111 while (
111112 i + 1 < blocks . length &&
112113 blocks [ i + 1 ] &&
@@ -118,27 +119,25 @@ export const Renderer: React.FC<Props> = React.memo(
118119 block . type !== 'bulleted_list_item' &&
119120 block . type !== 'numbered_list_item'
120121 ) {
121- result . push (
122- < BlockRenderer
123- key = { block . id }
124- block = { block }
125- index = { i }
126- onFocus = { ( ) => handleBlockFocus ( i ) }
127- />
128- ) ;
122+ result
123+ . push
124+ // <BlockRenderer
125+ // key={block.id}
126+ // block={block}
127+ // index={i}
128+ // onFocus={() => handleBlockFocus(i)}
129+ // />
130+ ( ) ;
129131 }
130132 }
131133
132134 return result ;
133135 } , [ blocks , handleBlockFocus ] ) ;
134136
135137 return (
136- < ThemeProvider theme = { theme } >
137- { /* <GlobalStyle /> */ }
138- < Container role = "main" aria-label = "Notion page content" >
139- { renderedBlocks }
140- </ Container >
141- </ ThemeProvider >
138+ < div className = { container } role = "main" aria-label = "Notion page content" >
139+ { renderedBlocks }
140+ </ div >
142141 ) ;
143142 }
144143) ;
0 commit comments