Skip to content

Commit 8e8abdc

Browse files
committed
Migrate MUI to version 5.beta5
1 parent ed70860 commit 8e8abdc

24 files changed

+7841
-6642
lines changed

package-lock.json

Lines changed: 7669 additions & 6130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"version": "1.0.0",
66
"private": false,
77
"scripts": {
8+
"eslint": "eslint ./src",
9+
"eslint-fix": "eslint --fix ./src",
810
"start": "react-scripts start",
911
"build": "react-scripts build",
1012
"test": "react-scripts test",
@@ -26,32 +28,28 @@
2628
]
2729
},
2830
"dependencies": {
29-
"@emotion/react": "^11.1.5",
30-
"@emotion/styled": "^11.1.5",
31-
"@material-ui/core": "^5.0.0-alpha.28",
32-
"@material-ui/icons": "^5.0.0-alpha.28",
33-
"@material-ui/styles": "^4.10.0",
34-
"chart.js": "^2.9.4",
35-
"clsx": "^1.1.1",
31+
"@emotion/react": "^11.4.1",
32+
"@emotion/styled": "^11.3.0",
33+
"@material-ui/core": "^5.0.0-beta.5",
34+
"@material-ui/icons": "^5.0.0-beta.5",
35+
"@material-ui/styles": "^5.0.0-beta.5",
36+
"chart.js": "^3.5.1",
3637
"formik": "^2.1.5",
3738
"history": "^5.0.0",
38-
"install": "^0.13.0",
39-
"lodash": "^4.17.19",
4039
"moment": "^2.27.0",
41-
"npm": "^7.7.4",
4240
"nprogress": "^0.2.0",
4341
"prop-types": "^15.7.2",
4442
"react": "^17.0.2",
45-
"react-chartjs-2": "^2.10.0",
43+
"react-chartjs-2": "^3.0.4",
4644
"react-dom": "^17.0.2",
4745
"react-feather": "^2.0.8",
4846
"react-helmet": "^6.1.0",
4947
"react-perfect-scrollbar": "^1.5.8",
5048
"react-router": "^6.0.0-beta.0",
5149
"react-router-dom": "^6.0.0-beta.0",
52-
"react-scripts": "^4.0.0",
50+
"react-scripts": "^4.0.3",
5351
"uuid": "^8.3.0",
54-
"yup": "^0.29.3"
52+
"yup": "^0.32.9"
5553
},
5654
"devDependencies": {
5755
"eslint-config-airbnb": "^18.2.1"

src/App.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import 'react-perfect-scrollbar/dist/css/styles.css';
22
import { useRoutes } from 'react-router-dom';
3-
import { ThemeProvider } from '@material-ui/core';
4-
import GlobalStyles from 'src/components/GlobalStyles';
5-
import 'src/mixins/chartjs';
6-
import theme from 'src/theme';
7-
import routes from 'src/routes';
3+
import { ThemeProvider, StyledEngineProvider } from '@material-ui/core';
4+
import GlobalStyles from './components/GlobalStyles';
5+
import theme from './theme';
6+
import routes from './routes';
87

98
const App = () => {
10-
const routing = useRoutes(routes);
9+
const content = useRoutes(routes);
1110

1211
return (
13-
<ThemeProvider theme={theme}>
14-
<GlobalStyles />
15-
{routing}
16-
</ThemeProvider>
12+
<StyledEngineProvider injectFirst>
13+
<ThemeProvider theme={theme}>
14+
<GlobalStyles />
15+
{content}
16+
</ThemeProvider>
17+
</StyledEngineProvider>
1718
);
1819
};
1920

src/components/DashboardLayout.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useState } from 'react';
22
import { Outlet } from 'react-router-dom';
3-
import { experimentalStyled } from '@material-ui/core';
3+
import { styled } from '@material-ui/core/styles';
44
import DashboardNavbar from './DashboardNavbar';
55
import DashboardSidebar from './DashboardSidebar';
66

7-
const DashboardLayoutRoot = experimentalStyled('div')(
7+
const DashboardLayoutRoot = styled('div')(
88
({ theme }) => ({
99
backgroundColor: theme.palette.background.default,
1010
display: 'flex',
@@ -14,7 +14,7 @@ const DashboardLayoutRoot = experimentalStyled('div')(
1414
})
1515
);
1616

17-
const DashboardLayoutWrapper = experimentalStyled('div')(
17+
const DashboardLayoutWrapper = styled('div')(
1818
({ theme }) => ({
1919
display: 'flex',
2020
flex: '1 1 auto',
@@ -26,13 +26,13 @@ const DashboardLayoutWrapper = experimentalStyled('div')(
2626
})
2727
);
2828

29-
const DashboardLayoutContainer = experimentalStyled('div')({
29+
const DashboardLayoutContainer = styled('div')({
3030
display: 'flex',
3131
flex: '1 1 auto',
3232
overflow: 'hidden'
3333
});
3434

35-
const DashboardLayoutContent = experimentalStyled('div')({
35+
const DashboardLayoutContent = styled('div')({
3636
flex: '1 1 auto',
3737
height: '100%',
3838
overflow: 'auto'

src/components/DashboardNavbar.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const DashboardNavbar = ({ onMobileNavOpen, ...rest }) => {
2727
<Logo />
2828
</RouterLink>
2929
<Box sx={{ flexGrow: 1 }} />
30-
<Hidden lgDown>
31-
<IconButton color="inherit">
30+
<Hidden xlDown>
31+
<IconButton color="inherit" size="large">
3232
<Badge
3333
badgeContent={notifications.length}
3434
color="primary"
@@ -37,15 +37,12 @@ const DashboardNavbar = ({ onMobileNavOpen, ...rest }) => {
3737
<NotificationsIcon />
3838
</Badge>
3939
</IconButton>
40-
<IconButton color="inherit">
40+
<IconButton color="inherit" size="large">
4141
<InputIcon />
4242
</IconButton>
4343
</Hidden>
4444
<Hidden lgUp>
45-
<IconButton
46-
color="inherit"
47-
onClick={onMobileNavOpen}
48-
>
45+
<IconButton color="inherit" onClick={onMobileNavOpen} size="large">
4946
<MenuIcon />
5047
</IconButton>
5148
</Hidden>

src/components/DashboardSidebar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const DashboardSidebar = ({ onMobileClose, openMobile }) => {
191191
{content}
192192
</Drawer>
193193
</Hidden>
194-
<Hidden lgDown>
194+
<Hidden xlDown>
195195
<Drawer
196196
anchor="left"
197197
open
@@ -217,7 +217,8 @@ DashboardSidebar.propTypes = {
217217
};
218218

219219
DashboardSidebar.defaultProps = {
220-
onMobileClose: () => { },
220+
onMobileClose: () => {
221+
},
221222
openMobile: false
222223
};
223224

src/components/GlobalStyles.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { createStyles, makeStyles } from '@material-ui/core';
1+
import createStyles from '@material-ui/styles/createStyles';
2+
import makeStyles from '@material-ui/styles/makeStyles';
23

34
const useStyles = makeStyles(() => createStyles({
45
'@global': {

src/components/MainLayout.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Outlet } from 'react-router-dom';
2-
import { experimentalStyled } from '@material-ui/core';
2+
import { styled } from '@material-ui/core/styles';
33
import MainNavbar from './MainNavbar';
44

5-
const MainLayoutRoot = experimentalStyled('div')(
5+
const MainLayoutRoot = styled('div')(
66
({ theme }) => ({
77
backgroundColor: theme.palette.background.paper,
88
display: 'flex',
@@ -12,20 +12,20 @@ const MainLayoutRoot = experimentalStyled('div')(
1212
})
1313
);
1414

15-
const MainLayoutWrapper = experimentalStyled('div')({
15+
const MainLayoutWrapper = styled('div')({
1616
display: 'flex',
1717
flex: '1 1 auto',
1818
overflow: 'hidden',
1919
paddingTop: 64
2020
});
2121

22-
const MainLayoutContainer = experimentalStyled('div')({
22+
const MainLayoutContainer = styled('div')({
2323
display: 'flex',
2424
flex: '1 1 auto',
2525
overflow: 'hidden'
2626
});
2727

28-
const MainLayoutContent = experimentalStyled('div')({
28+
const MainLayoutContent = styled('div')({
2929
flex: '1 1 auto',
3030
height: '100%',
3131
overflow: 'auto'

src/components/customer/CustomerListResults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
TableRow,
1616
Typography
1717
} from '@material-ui/core';
18-
import getInitials from 'src/utils/getInitials';
18+
import getInitials from '../../utils/getInitials';
1919

2020
const CustomerListResults = ({ customers, ...rest }) => {
2121
const [selectedCustomerIds, setSelectedCustomerIds] = useState([]);

src/components/dashboard/Sales.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,23 @@ const Sales = (props) => {
1919
datasets: [
2020
{
2121
backgroundColor: colors.indigo[500],
22+
barPercentage: 0.5,
23+
barThickness: 12,
24+
borderRadius: 4,
25+
categoryPercentage: 0.5,
2226
data: [18, 5, 19, 27, 29, 19, 20],
23-
label: 'This year'
27+
label: 'This year',
28+
maxBarThickness: 10
2429
},
2530
{
2631
backgroundColor: colors.grey[200],
32+
barPercentage: 0.5,
33+
barThickness: 12,
34+
borderRadius: 4,
35+
categoryPercentage: 0.5,
2736
data: [11, 20, 12, 29, 30, 25, 13],
28-
label: 'Last year'
37+
label: 'Last year',
38+
maxBarThickness: 10
2939
}
3040
],
3141
labels: ['1 Aug', '2 Aug', '3 Aug', '4 Aug', '5 Aug', '6 Aug']
@@ -41,10 +51,6 @@ const Sales = (props) => {
4151
scales: {
4252
xAxes: [
4353
{
44-
barThickness: 12,
45-
maxBarThickness: 10,
46-
barPercentage: 0.5,
47-
categoryPercentage: 0.5,
4854
ticks: {
4955
fontColor: theme.palette.text.secondary
5056
},

0 commit comments

Comments
 (0)