11import React from 'react' ;
22import ReactDOM from 'react-dom' ;
33import { HashRouter as Router , Route , Switch } from 'react-router-dom' ;
4- import { withStyles } from '@material-ui/core/ styles/index ' ;
4+ import { withStyles } from '@mui/ styles' ;
55import ExamplesGrid from './ExamplesGrid' ;
66import examples from '../examples' ;
7- import Button from '@material-ui/core /Button' ;
7+ import Button from '@mui/material /Button' ;
88import { withRouter } from 'react-router-dom' ;
9+ import { createTheme , ThemeProvider } from '@mui/material/styles' ;
910
1011const styles = {
1112 root : {
@@ -27,31 +28,35 @@ class Examples extends React.Component {
2728
2829 var returnHomeStyle = { padding : '0px' , margin : '20px 0 20px 0' } ;
2930
31+ const defaultTheme = createTheme ( ) ;
32+
3033 return (
31- < main className = { classes . root } >
32- < div className = { classes . contentWrapper } >
33- < Switch >
34- < Route path = "/" exact render = { ( ) => < ExamplesGrid examples = { examples } /> } />
35- { Object . keys ( examples ) . map ( ( label , index ) => (
36- < Route
37- key = { index }
38- path = { `/${ label . replace ( / \s + / g, '-' ) . toLowerCase ( ) } ` }
39- exact
40- component = { examples [ label ] }
41- />
42- ) ) }
43- </ Switch >
44- < div >
45- { this . props . location . pathname !== '/' && (
46- < div style = { returnHomeStyle } >
47- < Button color = "primary" onClick = { this . returnHome } >
48- Back to Example Index
49- </ Button >
50- </ div >
51- ) }
34+ < ThemeProvider theme = { defaultTheme } >
35+ < main className = { classes . root } >
36+ < div className = { classes . contentWrapper } >
37+ < Switch >
38+ < Route path = "/" exact render = { ( ) => < ExamplesGrid examples = { examples } /> } />
39+ { Object . keys ( examples ) . map ( ( label , index ) => (
40+ < Route
41+ key = { index }
42+ path = { `/${ label . replace ( / \s + / g, '-' ) . toLowerCase ( ) } ` }
43+ exact
44+ component = { examples [ label ] }
45+ />
46+ ) ) }
47+ </ Switch >
48+ < div >
49+ { this . props . location . pathname !== '/' && (
50+ < div style = { returnHomeStyle } >
51+ < Button color = "primary" onClick = { this . returnHome } >
52+ Back to Example Index
53+ </ Button >
54+ </ div >
55+ ) }
56+ </ div >
5257 </ div >
53- </ div >
54- </ main >
58+ </ main >
59+ </ ThemeProvider >
5560 ) ;
5661 }
5762}
0 commit comments