Skip to content

Commit 8ef33e3

Browse files
committed
Migration done
1 parent 8e19789 commit 8ef33e3

File tree

220 files changed

+4070
-4857
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+4070
-4857
lines changed

.gitignore

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
node_modules
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
.DS_Store
6+
7+
# testing
8+
/coverage
9+
10+
# production
11+
/build
12+
13+
# misc
14+
.DS_Store
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
24+
package-lock.json
25+
yarn.lock
26+
27+
commit.sh

package.json

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,30 @@
1414
"url": "git+https://github.com/creativetimofficial/soft-ui-dashboard-react.git"
1515
},
1616
"dependencies": {
17-
"@emotion/cache": "^11.4.0",
18-
"@emotion/react": "^11.4.1",
19-
"@emotion/styled": "^11.3.0",
20-
"@mui/icons-material": "^5.0.0",
21-
"@mui/material": "^5.0.0",
22-
"@mui/styled-engine": "^5.0.0",
23-
"@mui/styles": "^5.0.0",
24-
"@testing-library/jest-dom": "^5.11.4",
25-
"@testing-library/react": "^11.1.0",
26-
"@testing-library/user-event": "^12.1.10",
27-
"chart.js": "^3.4.1",
28-
"chroma-js": "^2.1.2",
29-
"clsx": "^1.1.1",
30-
"jss": "^10.7.1",
31-
"jss-rtl": "^0.3.0",
32-
"prop-types": "^15.7.2",
33-
"react": "^17.0.2",
34-
"react-chartjs-2": "^3.0.4",
35-
"react-countup": "^5.2.0",
36-
"react-dom": "^17.0.2",
37-
"react-flatpickr": "^3.10.7",
38-
"react-github-btn": "^1.2.1",
39-
"react-router-dom": "^5.2.0",
17+
"@emotion/cache": "11.4.0",
18+
"@emotion/react": "11.4.1",
19+
"@emotion/styled": "11.3.0",
20+
"@mui/icons-material": "5.1.1",
21+
"@mui/material": "5.1.1",
22+
"@mui/styled-engine": "5.1.1",
23+
"@testing-library/jest-dom": "5.11.4",
24+
"@testing-library/react": "11.1.0",
25+
"@testing-library/user-event": "12.1.10",
26+
"chart.js": "3.4.1",
27+
"chroma-js": "2.1.2",
28+
"prop-types": "15.7.2",
29+
"react": "17.0.2",
30+
"react-chartjs-2": "3.0.4",
31+
"react-countup": "5.2.0",
32+
"react-dom": "17.0.2",
33+
"react-flatpickr": "3.10.7",
34+
"react-github-btn": "1.2.1",
35+
"react-router-dom": "5.2.0",
4036
"react-scripts": "4.0.3",
41-
"stylis": "^4.0.10",
42-
"stylis-plugin-rtl": "^2.1.0",
43-
"web-vitals": "^1.0.1"
37+
"stylis": "4.0.10",
38+
"stylis-plugin-rtl": "2.1.0",
39+
"uuid": "8.3.2",
40+
"web-vitals": "1.0.1"
4441
},
4542
"scripts": {
4643
"start": "react-scripts start",
@@ -68,14 +65,14 @@
6865
]
6966
},
7067
"devDependencies": {
71-
"eslint": "^7.30.0",
72-
"eslint-config-airbnb": "^18.2.1",
73-
"eslint-config-prettier": "^8.3.0",
74-
"eslint-plugin-import": "^2.23.4",
75-
"eslint-plugin-jsx-a11y": "^6.4.1",
76-
"eslint-plugin-prettier": "^3.4.0",
77-
"eslint-plugin-react": "^7.24.0",
78-
"eslint-plugin-react-hooks": "^4.2.0",
79-
"prettier": "^2.3.2"
68+
"eslint": "7.30.0",
69+
"eslint-config-airbnb": "18.2.1",
70+
"eslint-config-prettier": "8.3.0",
71+
"eslint-plugin-import": "2.23.4",
72+
"eslint-plugin-jsx-a11y": "6.4.1",
73+
"eslint-plugin-prettier": "3.4.0",
74+
"eslint-plugin-react": "7.24.0",
75+
"eslint-plugin-react-hooks": "4.2.0",
76+
"prettier": "2.3.2"
8077
}
8178
}

src/App.js

Lines changed: 68 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
=========================================================
3-
* Soft UI Dashboard React - v2.0.0
3+
* Soft UI Dashboard PRO React - v3.0.0
44
=========================================================
55
6-
* Product Page: https://www.creative-tim.com/product/soft-ui-dashboard-pro-material-ui
6+
* Product Page: https://www.creative-tim.com/product/soft-ui-dashboard-pro-react
77
* Copyright 2021 Creative Tim (https://www.creative-tim.com)
88
99
Coded by www.creative-tim.com
@@ -18,17 +18,8 @@ import { useState, useEffect, useMemo } from "react";
1818
// react-router components
1919
import { Route, Switch, Redirect, useLocation } from "react-router-dom";
2020

21-
// jss components
22-
import { create } from "jss";
23-
24-
// jss-rtl components
25-
import rtl from "jss-rtl";
26-
27-
// @mui style components
28-
import { StylesProvider, jssPreset } from "@mui/styles";
29-
3021
// @mui material components
31-
import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles";
22+
import { ThemeProvider } from "@mui/material/styles";
3223
import CssBaseline from "@mui/material/CssBaseline";
3324
import Icon from "@mui/material/Icon";
3425

@@ -43,43 +34,56 @@ import Configurator from "examples/Configurator";
4334
import theme from "assets/theme";
4435
import themeRTL from "assets/theme/theme-rtl";
4536

37+
// RTL plugins
38+
import rtlPlugin from "stylis-plugin-rtl";
39+
import { CacheProvider } from "@emotion/react";
40+
import createCache from "@emotion/cache";
41+
4642
// Soft UI Dashboard PRO React routes
4743
import routes from "routes";
4844

4945
// Soft UI Dashboard PRO React contexts
50-
import { useSoftUIController } from "context";
46+
import { useSoftUIController, setMiniSidenav, setOpenConfigurator } from "context";
5147

52-
import rtlPlugin from "stylis-plugin-rtl";
53-
import { CacheProvider } from "@emotion/react";
54-
import createCache from "@emotion/cache";
48+
// Images
49+
import brand from "assets/images/logo-ct.png";
5550

5651
export default function App() {
5752
const [controller, dispatch] = useSoftUIController();
58-
const { direction, layout, openConfigurator } = controller;
53+
const { miniSidenav, direction, layout, openConfigurator, sidenavColor } = controller;
54+
const [onMouseEnter, setOnMouseEnter] = useState(false);
5955
const [rtlCache, setRtlCache] = useState(null);
6056
const { pathname } = useLocation();
6157

62-
// JSS presets for the rtl
63-
const jss = create({
64-
plugins: [...jssPreset().plugins, rtl()],
65-
});
66-
6758
// Cache for the rtl
6859
useMemo(() => {
6960
const cacheRtl = createCache({
7061
key: "rtl",
71-
prepend: true,
7262
stylisPlugins: [rtlPlugin],
7363
});
7464

7565
setRtlCache(cacheRtl);
7666
}, []);
7767

78-
// Change the openConfigurator state
79-
const handleConfiguratorOpen = () => {
80-
dispatch({ type: "OPEN_CONFIGURATOR", value: !openConfigurator });
68+
// Open sidenav when mouse enter on mini sidenav
69+
const handleOnMouseEnter = () => {
70+
if (miniSidenav && !onMouseEnter) {
71+
setMiniSidenav(dispatch, false);
72+
setOnMouseEnter(true);
73+
}
8174
};
8275

76+
// Close sidenav when mouse leave mini sidenav
77+
const handleOnMouseLeave = () => {
78+
if (onMouseEnter) {
79+
setMiniSidenav(dispatch, true);
80+
setOnMouseEnter(false);
81+
}
82+
};
83+
84+
// Change the openConfigurator state
85+
const handleConfiguratorOpen = () => setOpenConfigurator(dispatch, !openConfigurator);
86+
8387
// Setting the dir attribute for the body element
8488
useEffect(() => {
8589
document.body.setAttribute("dir", direction);
@@ -111,50 +115,37 @@ export default function App() {
111115
alignItems="center"
112116
width="3.5rem"
113117
height="3.5rem"
114-
backgroundColor="white"
115-
boxShadow="sm"
118+
bgColor="white"
119+
shadow="sm"
116120
borderRadius="50%"
117121
position="fixed"
118122
right="2rem"
119123
bottom="2rem"
120124
zIndex={99}
121-
customClass="cursor-pointer"
125+
color="dark"
126+
sx={{ cursor: "pointer" }}
122127
onClick={handleConfiguratorOpen}
123128
>
124-
<Icon className=" text-dark" fontSize="default">
129+
<Icon fontSize="default" color="inherit">
125130
settings
126131
</Icon>
127132
</SuiBox>
128133
);
129134

130135
return direction === "rtl" ? (
131136
<CacheProvider value={rtlCache}>
132-
<StylesProvider jss={jss}>
133-
<ThemeProvider theme={themeRTL}>
134-
<CssBaseline />
135-
{layout === "dashboard" && (
136-
<>
137-
<Sidenav routes={routes} />
138-
<Configurator />
139-
{configsButton}
140-
</>
141-
)}
142-
{layout === "vr" && <Configurator />}
143-
<Switch>
144-
{getRoutes(routes)}
145-
<Redirect from="*" to="/dashboard" />
146-
</Switch>
147-
</ThemeProvider>
148-
</StylesProvider>
149-
</CacheProvider>
150-
) : (
151-
// </CacheProvider>
152-
<StyledEngineProvider injectFirst>
153-
<ThemeProvider theme={theme}>
137+
<ThemeProvider theme={themeRTL}>
154138
<CssBaseline />
155139
{layout === "dashboard" && (
156140
<>
157-
<Sidenav routes={routes} />
141+
<Sidenav
142+
color={sidenavColor}
143+
brand={brand}
144+
brandName="Soft UI Dashboard"
145+
routes={routes}
146+
onMouseEnter={handleOnMouseEnter}
147+
onMouseLeave={handleOnMouseLeave}
148+
/>
158149
<Configurator />
159150
{configsButton}
160151
</>
@@ -165,6 +156,29 @@ export default function App() {
165156
<Redirect from="*" to="/dashboard" />
166157
</Switch>
167158
</ThemeProvider>
168-
</StyledEngineProvider>
159+
</CacheProvider>
160+
) : (
161+
<ThemeProvider theme={theme}>
162+
<CssBaseline />
163+
{layout === "dashboard" && (
164+
<>
165+
<Sidenav
166+
color={sidenavColor}
167+
brand={brand}
168+
brandName="Soft UI Dashboard"
169+
routes={routes}
170+
onMouseEnter={handleOnMouseEnter}
171+
onMouseLeave={handleOnMouseLeave}
172+
/>
173+
<Configurator />
174+
{configsButton}
175+
</>
176+
)}
177+
{layout === "vr" && <Configurator />}
178+
<Switch>
179+
{getRoutes(routes)}
180+
<Redirect from="*" to="/dashboard" />
181+
</Switch>
182+
</ThemeProvider>
169183
);
170184
}

src/assets/theme/base/boxShadows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const { black, white, info, inputColors, tabs } = colors;
3030
export default {
3131
xs: boxShadow([0, 2], [9, -5], black.main, 0.15),
3232
sm: boxShadow([0, 5], [10, 0], black.main, 0.12),
33-
regular: `${boxShadow([0, 4], [6, -1], black.light, 0.12)}, ${boxShadow(
33+
md: `${boxShadow([0, 4], [6, -1], black.light, 0.12)}, ${boxShadow(
3434
[0, 2],
3535
[4, -1],
3636
black.light,

0 commit comments

Comments
 (0)