@@ -7,6 +7,7 @@ import React, {
7
7
} from 'react' ;
8
8
import { ErrorBoundary } from 'react-error-boundary' ;
9
9
import clsx from 'clsx' ;
10
+ import { ScopedCssBaseline } from '@mui/material' ;
10
11
import { styled , SxProps } from '@mui/material/styles' ;
11
12
import { CoreLayoutProps } from 'ra-core' ;
12
13
@@ -39,34 +40,42 @@ export const Layout = (props: LayoutProps) => {
39
40
} ;
40
41
41
42
return (
42
- < StyledLayout className = { clsx ( 'layout' , className ) } { ...rest } >
43
- < SkipNavigationButton />
44
- < div className = { LayoutClasses . appFrame } >
45
- < AppBar open = { open } title = { title } />
46
- < main className = { LayoutClasses . contentWithSidebar } >
47
- < Sidebar >
48
- < Menu hasDashboard = { ! ! dashboard } />
49
- </ Sidebar >
50
- < div id = "main-content" className = { LayoutClasses . content } >
51
- < ErrorBoundary
52
- onError = { handleError }
53
- fallbackRender = { ( { error, resetErrorBoundary } ) => (
54
- < Error
55
- error = { error }
56
- errorComponent = { errorComponent }
57
- errorInfo = { errorInfo }
58
- resetErrorBoundary = { resetErrorBoundary }
59
- title = { title }
60
- />
61
- ) }
43
+ < ScopedCssBaseline enableColorScheme >
44
+ < StyledLayout className = { clsx ( 'layout' , className ) } { ...rest } >
45
+ < SkipNavigationButton />
46
+ < div className = { LayoutClasses . appFrame } >
47
+ < AppBar open = { open } title = { title } />
48
+ < main className = { LayoutClasses . contentWithSidebar } >
49
+ < Sidebar >
50
+ < Menu hasDashboard = { ! ! dashboard } />
51
+ </ Sidebar >
52
+ < div
53
+ id = "main-content"
54
+ className = { LayoutClasses . content }
62
55
>
63
- { children }
64
- </ ErrorBoundary >
65
- </ div >
66
- </ main >
67
- < Inspector />
68
- </ div >
69
- </ StyledLayout >
56
+ < ErrorBoundary
57
+ onError = { handleError }
58
+ fallbackRender = { ( {
59
+ error,
60
+ resetErrorBoundary,
61
+ } ) => (
62
+ < Error
63
+ error = { error }
64
+ errorComponent = { errorComponent }
65
+ errorInfo = { errorInfo }
66
+ resetErrorBoundary = { resetErrorBoundary }
67
+ title = { title }
68
+ />
69
+ ) }
70
+ >
71
+ { children }
72
+ </ ErrorBoundary >
73
+ </ div >
74
+ </ main >
75
+ < Inspector />
76
+ </ div >
77
+ </ StyledLayout >
78
+ </ ScopedCssBaseline >
70
79
) ;
71
80
} ;
72
81
0 commit comments