File tree Expand file tree Collapse file tree 4 files changed +27
-27
lines changed Expand file tree Collapse file tree 4 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,16 @@ export function FooterImpl() {
38
38
< div className = { styles . copyright } >
39
39
Copyright { currentYear } { config . author }
40
40
</ div >
41
-
42
41
< div className = { styles . settings } >
43
42
{ hasMounted && (
44
- < a
43
+ < button
44
+ type = "button"
45
45
className = { styles . toggleDarkMode }
46
- href = '#'
47
- role = 'button'
48
46
onClick = { onToggleDarkMode }
49
47
title = 'Toggle dark mode'
50
48
>
51
49
{ isDarkMode ? < IoMoonSharp /> : < IoSunnyOutline /> }
52
- </ a >
50
+ </ button >
53
51
) }
54
52
</ div >
55
53
Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ function ToggleThemeButton() {
23
23
} , [ toggleDarkMode ] )
24
24
25
25
return (
26
- < div
26
+ < button
27
+ type = "button"
27
28
className = { cs ( 'breadcrumb' , 'button' , ! hasMounted && styles . hidden ) }
28
29
onClick = { onToggleTheme }
29
30
>
30
31
{ hasMounted && isDarkMode ? < IoMoonSharp /> : < IoSunnyOutline /> }
31
- </ div >
32
+ </ button >
32
33
)
33
34
}
34
35
@@ -59,23 +60,22 @@ export function NotionPageHeader({
59
60
return (
60
61
< components . PageLink
61
62
href = { mapPageUrl ( link . pageId ) }
62
- key = { index }
63
+ key = { `nav- ${ link . pageId } - ${ link . title } ` }
63
64
className = { cs ( styles . navLink , 'breadcrumb' , 'button' ) }
64
65
>
65
66
{ link . title }
66
67
</ components . PageLink >
67
68
)
68
- } else {
69
- return (
70
- < components . Link
71
- href = { link . url }
72
- key = { index }
73
- className = { cs ( styles . navLink , 'breadcrumb' , 'button' ) }
74
- >
75
- { link . title }
76
- </ components . Link >
77
- )
78
69
}
70
+ return (
71
+ < components . Link
72
+ href = { link . url }
73
+ key = { `nav-${ link . url } -${ link . title } ` }
74
+ className = { cs ( styles . navLink , 'breadcrumb' , 'button' ) }
75
+ >
76
+ { link . title }
77
+ </ components . Link >
78
+ )
79
79
} )
80
80
. filter ( Boolean ) }
81
81
Original file line number Diff line number Diff line change 66
66
user-select : none;
67
67
}
68
68
69
- .settings a ,
69
+ .settings button ,
70
70
.social a {
71
71
cursor : pointer;
72
72
font-size : 2em ;
76
76
transition : color 250ms ease-out;
77
77
}
78
78
79
- .settings a : last-of-type ,
79
+ .settings button : last-of-type ,
80
80
.social a : last-of-type {
81
81
margin-right : 0 ;
82
82
}
83
83
84
- .settings a : hover ,
84
+ .settings button : hover ,
85
85
.social a : hover {
86
86
transition : color 50ms ease-out;
87
87
}
88
88
89
- .toggleDarkMode : hover {
90
- color : # 2795e9 ;
89
+ .settings button {
90
+ /* Reset default button styles */
91
+ background : none;
92
+ border : none;
91
93
}
92
94
93
95
.twitter : hover {
Original file line number Diff line number Diff line change 1
1
import ky from 'ky'
2
2
import lqip from 'lqip-modern'
3
- import {
4
- type ExtendedRecordMap ,
5
- type PreviewImage ,
6
- type PreviewImageMap
3
+ import type {
4
+ ExtendedRecordMap ,
5
+ PreviewImage ,
6
+ PreviewImageMap
7
7
} from 'notion-types'
8
8
import { getPageImageUrls , normalizeUrl } from 'notion-utils'
9
9
import pMap from 'p-map'
You can’t perform that action at this time.
0 commit comments