Skip to content

Commit

Permalink
refactor: upgrade to react@18
Browse files Browse the repository at this point in the history
  • Loading branch information
lwhiteley committed Oct 6, 2024
1 parent 265acfe commit 3da5250
Show file tree
Hide file tree
Showing 51 changed files with 785 additions and 437 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/unused-dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Unused Dependencies'
on: [pull_request]

permissions:
contents: read
permissions:
contents: read

jobs:
unused-dependecies:
Expand All @@ -15,11 +15,10 @@ jobs:
with:
node-version: '18.x'
- name: 'Run depcheck'
run: |
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier"
run: |
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,@emotion/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier"
echo $?
if [[ $? == 1 ]]; then
echo "Unused dependencies or devDependencies found"
exit 1
fi
748 changes: 544 additions & 204 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
"author": "Paul Groves",
"license": "Apache-2.0",
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "4.11.3",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/styles": "^6.1.2",
"@primer/octicons-react": "^19.8.0",
"@seald-io/nedb": "^4.0.2",
"axios": "^1.6.0",
Expand Down Expand Up @@ -62,8 +65,8 @@
"passport-local": "^1.0.0",
"perfect-scrollbar": "^1.5.5",
"prop-types": "15.8.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "6.26.2",
"uuid": "^10.0.0",
"yargs": "^17.7.2"
Expand Down
26 changes: 16 additions & 10 deletions src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { createBrowserHistory } from 'history';
import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom';
import { createTheme, ThemeProvider } from '@mui/material/styles';

// core components
import Admin from './ui/layouts/Admin';
Expand All @@ -10,13 +11,18 @@ import './ui/assets/css/material-dashboard-react.css';

const hist = createBrowserHistory();

ReactDOM.render(
<Router history={hist}>
<Routes>
<Route exact path='/admin/*' element={<Admin />} />
<Route exact path='/login' element={<Login />} />
<Route exact path='/' element={<Navigate from='/' to='/admin/repo' />} />
</Routes>
</Router>,
document.getElementById('root'),
const container = document.getElementById('root');
const root = createRoot(container);
const theme = createTheme();

root.render(
<ThemeProvider theme={theme}>
<Router history={hist}>
<Routes>
<Route exact path='/admin/*' element={<Admin />} />
<Route exact path='/login' element={<Login />} />
<Route exact path='/' element={<Navigate from='/' to='/admin/repo' />} />
</Routes>
</Router>
</ThemeProvider>,
);
4 changes: 2 additions & 2 deletions src/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import Person from '@material-ui/icons/Person';
import { Person } from '@mui/icons-material';
import OpenPushRequests from './ui/views/OpenPushRequests/OpenPushRequests';
import PushDetails from './ui/views/PushDetails/PushDetails';
import User from './ui/views/User/User';
Expand All @@ -26,7 +26,7 @@ import RepoList from './ui/views/RepoList/RepoList';

import { RepoIcon } from '@primer/octicons-react';

import { Group, AccountCircle, Dashboard } from '@material-ui/icons';
import { Group, AccountCircle, Dashboard } from '@mui/icons-material';

const dashboardRoutes = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const headerLinksStyle = (theme) => ({
'& > div': {
marginTop: '0',
},
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
margin: '10px 15px !important',
float: 'none !important',
paddingTop: '1px',
Expand All @@ -29,7 +29,7 @@ const headerLinksStyle = (theme) => ({
margin: '0px',
},
buttonLink: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
display: 'flex',
margin: '10px 15px 0',
width: '-webkit-fill-available',
Expand All @@ -54,7 +54,7 @@ const headerLinksStyle = (theme) => ({
},
},
searchButton: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
top: '-50px !important',
marginRight: '22px',
float: 'right',
Expand Down Expand Up @@ -86,20 +86,20 @@ const headerLinksStyle = (theme) => ({
verticalAlign: 'middle',
display: 'block',
},
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
...defaultFont,
fontSize: '14px',
marginRight: '8px',
},
},
manager: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
width: '100%',
},
display: 'inline-block',
},
searchWrapper: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
width: '-webkit-fill-available',
margin: '10px 15px 0',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const headerLinksStyle = (theme) => ({
'& > div': {
marginTop: '0',
},
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
margin: '10px 15px !important',
float: 'none !important',
paddingTop: '1px',
Expand All @@ -28,7 +28,7 @@ const headerLinksStyle = (theme) => ({
margin: '0px',
},
buttonLink: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
display: 'flex',
margin: '10px 15px 0',
width: '-webkit-fill-available',
Expand All @@ -53,7 +53,7 @@ const headerLinksStyle = (theme) => ({
},
},
searchButton: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
top: '-50px !important',
marginRight: '22px',
float: 'right',
Expand Down Expand Up @@ -85,20 +85,20 @@ const headerLinksStyle = (theme) => ({
verticalAlign: 'middle',
display: 'block',
},
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
...defaultFont,
fontSize: '14px',
marginRight: '8px',
},
},
manager: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
width: '100%',
},
display: 'inline-block',
},
searchWrapper: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
width: '-webkit-fill-available',
margin: '10px 15px 0',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const sidebarStyle = (theme) => ({
position: 'fixed',
height: '100%',
},
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
width: drawerWidth,
...boxShadow,
position: 'fixed',
Expand All @@ -55,7 +55,7 @@ const sidebarStyle = (theme) => ({
left: 'auto !important',
right: '0 !important',
},
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
left: '0 !important',
right: 'auto !important',
},
Expand Down
8 changes: 4 additions & 4 deletions src/ui/assets/jss/material-dashboard-react/dropdownStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

const dropdownStyle = (theme) => ({
buttonLink: {
[theme.breakpoints.down('md')]: {
[theme.breakpoints.down('lg')]: {
display: 'flex',
marginLeft: '30px',
width: 'auto',
Expand All @@ -20,7 +20,7 @@ const dropdownStyle = (theme) => ({
width: '20px',
height: '20px',
zIndex: '4',
[theme.breakpoints.down('md')]: {
[theme.breakpoints.down('lg')]: {
display: 'block',
width: '30px',
height: '30px',
Expand All @@ -37,7 +37,7 @@ const dropdownStyle = (theme) => ({
pointerEvents: 'none',
},
popperResponsive: {
[theme.breakpoints.down('md')]: {
[theme.breakpoints.down('lg')]: {
zIndex: '1640',
position: 'static',
float: 'none',
Expand All @@ -51,7 +51,7 @@ const dropdownStyle = (theme) => ({
},
},
popperNav: {
[theme.breakpoints.down('sm')]: {
[theme.breakpoints.down('md')]: {
position: 'static !important',
left: 'unset !important',
top: 'unset !important',
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Card/Card.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import makeStyles from '@mui/styles/makeStyles';
import styles from '../../assets/jss/material-dashboard-react/components/cardStyle';

const useStyles = makeStyles(styles);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Card/CardAvatar.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import makeStyles from '@mui/styles/makeStyles';
import styles from '../../assets/jss/material-dashboard-react/components/cardAvatarStyle';

const useStyles = makeStyles(styles);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Card/CardBody.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import makeStyles from '@mui/styles/makeStyles';
import styles from '../../assets/jss/material-dashboard-react/components/cardBodyStyle';

const useStyles = makeStyles(styles);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Card/CardFooter.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import makeStyles from '@mui/styles/makeStyles';
import styles from '../../assets/jss/material-dashboard-react/components/cardFooterStyle';

const useStyles = makeStyles(styles);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Card/CardHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import makeStyles from '@mui/styles/makeStyles';
import styles from '../../assets/jss/material-dashboard-react/components/cardHeaderStyle';

const useStyles = makeStyles(styles);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Card/CardIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import makeStyles from '@mui/styles/makeStyles';
import styles from '../../assets/jss/material-dashboard-react/components/cardIconStyle';

const useStyles = makeStyles(styles);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/CustomButtons/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import makeStyles from '@mui/styles/makeStyles';
import Button from '@mui/material/Button';
import styles from '../../assets/jss/material-dashboard-react/components/buttonStyle';

const useStyles = makeStyles(styles);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/CustomButtons/CodeActionButton.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Popper from '@material-ui/core/Popper';
import Paper from '@material-ui/core/Paper';
import Popper from '@mui/material/Popper';
import Paper from '@mui/material/Paper';
import {
CheckIcon,
ChevronDownIcon,
Expand Down
11 changes: 5 additions & 6 deletions src/ui/components/CustomInput/CustomInput.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import FormControl from '@material-ui/core/FormControl';
import InputLabel from '@material-ui/core/InputLabel';
import Input from '@material-ui/core/Input';
import Clear from '@material-ui/icons/Clear';
import Check from '@material-ui/icons/Check';
import makeStyles from '@mui/styles/makeStyles';
import FormControl from '@mui/material/FormControl';
import InputLabel from '@mui/material/InputLabel';
import Input from '@mui/material/Input';
import { Clear, Check } from '@mui/icons-material';
import styles from '../../assets/jss/material-dashboard-react/components/customInputStyle';

const useStyles = makeStyles(styles);
Expand Down
6 changes: 3 additions & 3 deletions src/ui/components/CustomTabs/CustomTabs.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import makeStyles from '@mui/styles/makeStyles';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import Card from '../Card/Card';
import CardBody from '../Card/CardBody';
import CardHeader from '../Card/CardHeader';
Expand Down
6 changes: 3 additions & 3 deletions src/ui/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import ListItem from '@material-ui/core/ListItem';
import List from '@material-ui/core/List';
import makeStyles from '@mui/styles/makeStyles';
import ListItem from '@mui/material/ListItem';
import List from '@mui/material/List';
import styles from '../../assets/jss/material-dashboard-react/components/footerStyle';
import { MarkGithubIcon } from '@primer/octicons-react';

Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/Grid/GridContainer.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import makeStyles from '@mui/styles/makeStyles';
import Grid from '@mui/material/Grid';

const styles = {
grid: {
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/Grid/GridItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import makeStyles from '@mui/styles/makeStyles';
import Grid from '@mui/material/Grid';

const styles = {
grid: {
Expand Down
Loading

0 comments on commit 3da5250

Please sign in to comment.