File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
packages/react-notion-x/src/components Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const PageIconImpl: React.FC<{
29
29
hideDefaultIcon = false ,
30
30
defaultIcon
31
31
} ) => {
32
- const { mapImageUrl, recordMap } = useNotionContext ( )
32
+ const { mapImageUrl, recordMap, darkMode } = useNotionContext ( )
33
33
let isImage = false
34
34
let content : any = null
35
35
@@ -41,6 +41,20 @@ export const PageIconImpl: React.FC<{
41
41
const url = mapImageUrl ( icon , block )
42
42
isImage = true
43
43
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
+ 'https://www.notion.so' +
54
+ icon +
55
+ '?mode=' +
56
+ ( darkMode ? 'dark' : 'light' )
57
+
44
58
content = (
45
59
< LazyImage
46
60
src = { url }
You can’t perform that action at this time.
0 commit comments