@@ -2,55 +2,57 @@ import * as React from 'react';
22import Paper from '@mui/material/Paper' ;
33import Box from '@mui/material/Box' ;
44import { Grid } from '@mui/material' ;
5- import { createTheme , ThemeProvider } from '@mui/material/styles' ;
5+ import { useTheme , ThemeProvider } from '@mui/material/styles' ;
66import PsychologyIcon from '@mui/icons-material/Psychology' ;
77import HandshakeIcon from '@mui/icons-material/Handshake' ;
88import WorkIcon from '@mui/icons-material/Work' ;
99import UpgradeIcon from '@mui/icons-material/Upgrade' ;
1010import { styled } from '@mui/material/styles' ;
1111import './PreContact.css' ;
1212
13- const theme = createTheme ( {
14- status : {
15- danger : ' #eaeaea' ,
16- } ,
17- palette : {
18- primary : {
19- main : '#232526' ,
20- darker : '#135d66' ,
21- } ,
22- neutral : {
23- main : '#BFD9DD' ,
24- contrastText : '#333' ,
25- } ,
26- container : {
27- height : '20rem' ,
28- display : 'flex' ,
29- flexDirection : 'column' ,
30- justifyContent : 'center' ,
31- } ,
32- h2 : {
33- fontSize : '112rem' ,
34- fontWeight : 'bold' ,
35- color : 'red' ,
36- }
37- } ,
38- } ) ;
13+ // const theme = createTheme({
14+ // status: {
15+ // danger: ' #eaeaea',
16+ // },
17+ // palette: {
18+ // primary: {
19+ // main: '#232526',
20+ // darker: '#135d66',
21+ // },
22+ // neutral: {
23+ // main: '#BFD9DD',
24+ // contrastText: '#333',
25+ // },
26+ // container: {
27+ // height: '20rem',
28+ // display: 'flex',
29+ // flexDirection: 'column',
30+ // justifyContent: 'center',
31+ // },
32+ // h2: {
33+ // fontSize: '112rem',
34+ // fontWeight: 'bold',
35+ // color: 'red',
36+ // }
37+ // },
38+ // });
3939
4040const Item = styled ( Paper ) ( ( { theme } ) => ( {
4141
42+
43+
4244 backgroundColor : theme . palette . mode === 'dark' ? '#1A2027' : '#232526' ,
4345 ...theme . typography . body2 ,
4446 padding : theme . spacing ( 1 ) ,
4547 textAlign : 'center' ,
4648 color : theme . palette . text . secondary ,
4749}
48- ) ) ; console . log ( theme . palette . mode )
50+ ) ) ;
4951
5052
5153
5254function PreContact ( ) {
53-
55+ const theme = useTheme ( ) ;
5456 return (
5557 < ThemeProvider theme = { theme } >
5658 < Grid item xs = { 12 } sm = { 8 } md = { 5 } component = { Paper } elevation = { 6 } square >
@@ -93,9 +95,6 @@ function PreContact() {
9395
9496 </ Box >
9597 </ Grid >
96-
97-
98-
9998 </ ThemeProvider >
10099 ) ;
101100}
0 commit comments