File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/react-notion-x/src/components Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const PageIconImpl: React.FC<{
2929 hideDefaultIcon = false ,
3030 defaultIcon
3131} ) => {
32- const { mapImageUrl, recordMap } = useNotionContext ( )
32+ const { mapImageUrl, recordMap, darkMode } = useNotionContext ( )
3333 let isImage = false
3434 let content : any = null
3535
@@ -41,6 +41,17 @@ export const PageIconImpl: React.FC<{
4141 const url = mapImageUrl ( icon , block )
4242 isImage = true
4343
44+ content = (
45+ < LazyImage
46+ src = { url }
47+ alt = { title || 'page icon' }
48+ className = { cs ( className , 'notion-page-icon' ) }
49+ />
50+ )
51+ } else if ( icon && icon . startsWith ( '/icons/' ) ) {
52+ const url =
53+ 'http://www.notion.so' + icon + '?mode=' + ( darkMode ? 'dark' : 'light' )
54+
4455 content = (
4556 < LazyImage
4657 src = { url }
You can’t perform that action at this time.
0 commit comments