Skip to content

Commit 004659b

Browse files
authored
Changes to support upgrade of platform-espressif32 to 4.3.0 (#301)
* support latest espressif32 PIO platform * upgrade react, react router, axios and material
1 parent baae203 commit 004659b

21 files changed

+895
-772
lines changed

interface/package-lock.json

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

interface/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44
"private": true,
55
"proxy": "http://192.168.0.23",
66
"dependencies": {
7-
"@emotion/react": "^11.7.1",
8-
"@emotion/styled": "^11.6.0",
9-
"@mui/icons-material": "^5.2.4",
10-
"@mui/material": "^5.2.4",
7+
"@emotion/react": "^11.9.0",
8+
"@emotion/styled": "^11.8.1",
9+
"@mui/icons-material": "^5.8.0",
10+
"@mui/material": "^5.8.0",
1111
"@types/lodash": "^4.14.176",
1212
"@types/node": "^16.11.14",
13-
"@types/react": "^17.0.37",
14-
"@types/react-dom": "^17.0.11",
15-
"async-validator": "^4.0.7",
16-
"axios": "^0.24.0",
13+
"@types/react": "^18.0.9",
14+
"@types/react-dom": "^18.0.4",
15+
"async-validator": "^4.1.1",
16+
"axios": "^0.27.2",
1717
"http-proxy-middleware": "^2.0.1",
1818
"jwt-decode": "^3.1.2",
1919
"lodash": "^4.17.21",
20-
"notistack": "^2.0.3",
20+
"notistack": "^2.0.5",
2121
"parse-ms": "^3.0.0",
22-
"react": "^17.0.2",
22+
"react": "^18.1.0",
2323
"react-app-rewired": "^2.1.8",
24-
"react-dom": "^17.0.2",
24+
"react-dom": "^18.1.0",
2525
"react-dropzone": "^11.4.2",
26-
"react-router-dom": "^6.0.2",
27-
"react-scripts": "5.0.0",
26+
"react-router-dom": "^6.3.0",
27+
"react-scripts": "5.0.1",
2828
"sockette": "^2.0.6",
29-
"typescript": "^4.5.4"
29+
"typescript": "^4.6.4"
3030
},
3131
"scripts": {
3232
"start": "react-app-rewired start",

interface/src/CustomTheme.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { CssBaseline } from '@mui/material';
44
import { createTheme, responsiveFontSizes, ThemeProvider } from '@mui/material/styles';
55
import { indigo, blueGrey, orange, red, green } from '@mui/material/colors';
66

7+
import { RequiredChildrenProps } from './utils';
8+
79
const theme = responsiveFontSizes(
810
createTheme({
911
palette: {
@@ -28,7 +30,7 @@ const theme = responsiveFontSizes(
2830
})
2931
);
3032

31-
const CustomTheme: FC = ({ children }) => (
33+
const CustomTheme: FC<RequiredChildrenProps> = ({ children }) => (
3234
<ThemeProvider theme={theme}>
3335
<CssBaseline />
3436
{children}

interface/src/components/SectionContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import React from 'react';
22

33
import { Paper, Typography } from '@mui/material';
44

5-
interface SectionContentProps {
5+
import { RequiredChildrenProps } from '../utils';
6+
7+
interface SectionContentProps extends RequiredChildrenProps {
68
title: string;
79
titleGutter?: boolean;
810
}

interface/src/components/layout/Layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import { useLocation } from 'react-router-dom';
55
import { Box, Toolbar } from '@mui/material';
66

77
import { PROJECT_NAME } from '../../api/env';
8+
import { RequiredChildrenProps } from '../../utils';
9+
810
import LayoutDrawer from './LayoutDrawer';
911
import LayoutAppBar from './LayoutAppBar';
1012
import { LayoutContext } from './context';
1113

1214
export const DRAWER_WIDTH = 280;
1315

14-
const Layout: FC = ({ children }) => {
16+
const Layout: FC<RequiredChildrenProps> = ({ children }) => {
1517

1618
const [mobileOpen, setMobileOpen] = useState(false);
1719
const [title, setTitle] = useState(PROJECT_NAME);

interface/src/components/routing/RequireAdmin.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { FC, useContext } from 'react';
22
import { Navigate } from "react-router-dom";
33

44
import { AuthenticatedContext } from '../../contexts/authentication';
5+
import { RequiredChildrenProps } from '../../utils';
56

6-
const RequireAdmin: FC = ({ children }) => {
7+
const RequireAdmin: FC<RequiredChildrenProps> = ({ children }) => {
78
const authenticatedContext = useContext(AuthenticatedContext);
89
return authenticatedContext.me.admin ? <>{children}</> : <Navigate replace to='/' />;
910
};

interface/src/components/routing/RequireAuthenticated.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { Navigate, useLocation } from "react-router-dom";
33

44
import { AuthenticatedContext, AuthenticatedContextValue, AuthenticationContext } from '../../contexts/authentication/context';
55
import { storeLoginRedirect } from '../../api/authentication';
6+
import { RequiredChildrenProps } from '../../utils';
67

7-
const RequireAuthenticated: FC = ({ children }) => {
8+
const RequireAuthenticated: FC<RequiredChildrenProps> = ({ children }) => {
89
const authenticationContext = useContext(AuthenticationContext);
910
const location = useLocation();
1011

interface/src/components/routing/RequireUnauthenticated.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { Navigate } from "react-router-dom";
33

44
import * as AuthenticationApi from '../../api/authentication';
55
import { AuthenticationContext } from '../../contexts/authentication';
6+
import { RequiredChildrenProps } from '../../utils';
67
import { FeaturesContext } from '../../contexts/features';
78

8-
const RequireUnauthenticated: FC = ({ children }) => {
9+
const RequireUnauthenticated: FC<RequiredChildrenProps> = ({ children }) => {
910
const { features } = useContext(FeaturesContext);
1011
const authenticationContext = useContext(AuthenticationContext);
1112

interface/src/components/routing/RouterTabs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { useNavigate } from 'react-router-dom';
44

55
import { Tabs, useMediaQuery, useTheme } from '@mui/material';
66

7-
interface RouterTabsProps {
7+
import { RequiredChildrenProps } from '../../utils';
8+
9+
interface RouterTabsProps extends RequiredChildrenProps {
810
value: string | false;
911
}
1012

interface/src/contexts/authentication/Authentication.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { useNavigate } from 'react-router-dom';
44

55
import * as AuthenticationApi from '../../api/authentication';
66
import { ACCESS_TOKEN } from '../../api/endpoints';
7+
import { RequiredChildrenProps } from '../../utils';
78
import { LoadingSpinner } from '../../components';
89
import { Me } from '../../types';
10+
911
import { FeaturesContext } from '../features';
1012
import { AuthenticationContext } from './context';
1113

12-
const Authentication: FC = ({ children }) => {
14+
const Authentication: FC<RequiredChildrenProps> = ({ children }) => {
1315
const { features } = useContext(FeaturesContext);
1416
const navigate = useNavigate();
1517
const { enqueueSnackbar } = useSnackbar();

0 commit comments

Comments
 (0)