File tree 7 files changed +18
-16
lines changed
7 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ export default function App() {
20
20
createEffect ( ( ) => {
21
21
const html = document . documentElement ;
22
22
html . classList . remove ( "light" , "dark" ) ;
23
- html . classList . add ( ctx . selectedTheme ( ) . value ) ;
24
- html . dataset . theme = ctx . selectedTheme ( ) . theme ;
23
+ html . classList . add ( ctx . selectedTheme ( ) ! . value ) ;
24
+ html . dataset . theme = ctx . selectedTheme ( ) ! . theme ;
25
25
} ) ;
26
26
27
27
return (
Original file line number Diff line number Diff line change 1
1
import { createContext , ParentProps , useContext } from "solid-js" ;
2
2
import { SetStoreFunction , createStore } from "solid-js/store" ;
3
3
4
- type ChildSection = {
5
- text : string | undefined ;
4
+ export type ChildSection = {
5
+ text ? : string | null ;
6
6
id : string ;
7
7
level : number ;
8
8
} ;
9
9
10
- type ParentSection = {
11
- text : string | undefined ;
10
+ export type ParentSection = {
11
+ text ? : string | null ;
12
12
id : string ;
13
13
level : number ;
14
- children : ChildSection [ ] | [ ] ;
14
+ children : ChildSection [ ] ;
15
15
} ;
16
16
17
17
type PageStateStore = {
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export const ThemeProvider = (props: ParentProps) => {
70
70
} ) ;
71
71
createEffect ( ( ) => {
72
72
if ( selectedTheme ( ) ?. value )
73
- document . cookie = `theme=${ selectedTheme ( ) . value } ;path=/;max-age=${ 60 * 60 * 24 * 365 } ` ;
73
+ document . cookie = `theme=${ selectedTheme ( ) ! . value } ;path=/;max-age=${ 60 * 60 * 24 * 365 } ` ;
74
74
} ) ;
75
75
return (
76
76
< ThemeCtx . Provider
Original file line number Diff line number Diff line change 1
1
import { mount , StartClient } from "@solidjs/start/client" ;
2
2
3
- mount ( ( ) => < StartClient /> , document . getElementById ( "app" ) ) ;
3
+ mount ( ( ) => < StartClient /> , document . getElementById ( "app" ) ! ) ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export default function EraserOrAnchor(props: ParentProps<{ href: string }>) {
97
97
98
98
return (
99
99
< Show
100
- when = { eraserLinkData !== null }
100
+ when = { eraserLinkData }
101
101
fallback = {
102
102
< a
103
103
{ ...props }
@@ -108,7 +108,9 @@ export default function EraserOrAnchor(props: ParentProps<{ href: string }>) {
108
108
</ a >
109
109
}
110
110
>
111
- < EraserLink linkData = { eraserLinkData } > { props . children } </ EraserLink >
111
+ { ( eraserLinkData ) => (
112
+ < EraserLink linkData = { eraserLinkData ( ) } > { props . children } </ EraserLink >
113
+ ) }
112
114
</ Show >
113
115
) ;
114
116
}
Original file line number Diff line number Diff line change 9
9
type ResolvedChildren ,
10
10
} from "solid-js" ;
11
11
import { useLocation } from "@solidjs/router" ;
12
- import { usePageState } from "~/data/page-state" ;
12
+ import { ChildSection , ParentSection , usePageState } from "~/data/page-state" ;
13
13
import { useI18n } from "~/i18n/i18n-context" ;
14
14
15
15
export const TableOfContents : Component < { children : ResolvedChildren } > = (
@@ -49,7 +49,7 @@ export const TableOfContents: Component<{ children: ResolvedChildren }> = (
49
49
}
50
50
51
51
const headings = document . querySelectorAll ( "main h2, main h3" ) ;
52
- const sections : unknown [ ] = [ ] ;
52
+ const sections : ParentSection [ ] = [ ] ;
53
53
54
54
if ( headings ) {
55
55
headings . forEach ( ( heading ) => {
Original file line number Diff line number Diff line change 1
1
import { A } from "~/ui/i18n-anchor" ;
2
2
import { Show , Suspense , createMemo } from "solid-js" ;
3
- import flatEntries from "solid:collection/entries " ;
3
+ import { coreEntries } from "solid:collection" ;
4
4
import { useI18n } from "~/i18n/i18n-context" ;
5
5
6
6
/**
7
7
* temporary until we have proper types inside collections
8
8
*/
9
- type ReferenceCollection = ( typeof flatEntries ) [ "references " ] ;
10
- type LearnCollection = ( typeof flatEntries ) [ "learn" ] ;
9
+ type ReferenceCollection = ( typeof coreEntries ) [ "reference " ] ;
10
+ type LearnCollection = ( typeof coreEntries ) [ "learn" ] ;
11
11
12
12
type Pagination = {
13
13
collection : ReferenceCollection | LearnCollection ;
You can’t perform that action at this time.
0 commit comments