@@ -15,6 +15,7 @@ import Light from "@spectrum-icons/workflow/Light";
15
15
import { ToastContainer } from "@react-spectrum/toast" ;
16
16
import { enableTableNestedRows } from '@react-stately/flags' ;
17
17
import { useRouter , type NextRouter } from 'next/router' ;
18
+ import Script from 'next/script' ;
18
19
19
20
declare module '@adobe/react-spectrum' {
20
21
interface RouterConfig {
@@ -31,39 +32,53 @@ function MyApp({ Component, pageProps }: AppProps) {
31
32
enableTableNestedRows ( ) ;
32
33
33
34
return (
34
- < Provider
35
- theme = { lightTheme }
36
- colorScheme = { theme }
37
- router = { {
38
- navigate : ( href , opts ) => router . push ( href , undefined , opts ) ,
39
- useHref : ( href : string ) => router . basePath + href
40
- } }
41
- locale = "en" >
42
- < Grid
43
- areas = { [ "header" , "content" ] }
44
- columns = { [ "1fr" ] }
45
- rows = { [ "size-200" , "auto" ] }
46
- gap = "size-100"
47
- >
48
- < Flex
49
- direction = "row"
35
+ < >
36
+ < Script id = "font-loading" >
37
+ {
38
+ `(function(d) {
39
+ var config = {
40
+ kitId: 'uei1lip',
41
+ scriptTimeout: 3000,
42
+ async: true
43
+ },
44
+ h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
45
+ })(document);`
46
+ }
47
+ </ Script >
48
+ < Provider
49
+ theme = { lightTheme }
50
+ colorScheme = { theme }
51
+ router = { {
52
+ navigate : ( href , opts ) => router . push ( href , undefined , opts ) ,
53
+ useHref : ( href : string ) => router . basePath + href
54
+ } }
55
+ locale = "en" >
56
+ < Grid
57
+ areas = { [ "header" , "content" ] }
58
+ columns = { [ "1fr" ] }
59
+ rows = { [ "size-200" , "auto" ] }
50
60
gap = "size-100"
51
- justifyContent = "end"
52
- margin = "size-100"
53
61
>
54
- < ActionButton
55
- aria-label = { `Switch to ${ otherTheme } mode.` }
56
- onPress = { ( ) => setTheme ( otherTheme ) }
62
+ < Flex
63
+ direction = "row"
64
+ gap = "size-100"
65
+ justifyContent = "end"
66
+ margin = "size-100"
57
67
>
58
- { themeIcons [ otherTheme ] }
59
- </ ActionButton >
60
- </ Flex >
61
- < View >
62
- < Component { ...pageProps } />
63
- </ View >
64
- </ Grid >
65
- < ToastContainer />
66
- </ Provider >
68
+ < ActionButton
69
+ aria-label = { `Switch to ${ otherTheme } mode.` }
70
+ onPress = { ( ) => setTheme ( otherTheme ) }
71
+ >
72
+ { themeIcons [ otherTheme ] }
73
+ </ ActionButton >
74
+ </ Flex >
75
+ < View >
76
+ < Component { ...pageProps } />
77
+ </ View >
78
+ </ Grid >
79
+ < ToastContainer />
80
+ </ Provider >
81
+ </ >
67
82
) ;
68
83
}
69
84
export default MyApp ;
0 commit comments