Skip to content

Commit

Permalink
Merge pull request #450 from freifunkMUC/dependabot/npm_and_yarn/webs…
Browse files Browse the repository at this point in the history
…ite/react-router-dom-6.15.0

build(deps): bump react-router-dom from 5.3.4 to 6.15.0 in /website
  • Loading branch information
nwaldispuehl authored Sep 20, 2023
2 parents c5f9e30 + 94533cd commit 494becf
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 159 deletions.
196 changes: 47 additions & 149 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"qrcode": "^1.5.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.4",
"react-router-dom": "^6.15.0",
"react-scripts": "^5.0.1",
"tweetnacl-ts": "^1.0.3"
},
Expand Down
10 changes: 5 additions & 5 deletions website/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import CssBaseline from '@material-ui/core/CssBaseline';
import Box from '@material-ui/core/Box';
import Navigation from './components/Navigation';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { observer } from 'mobx-react';
import { grpc } from './Api';
import { AppState } from './AppState';
Expand All @@ -23,14 +23,14 @@ export const App = observer(class App extends React.Component {
<CssBaseline />
<Navigation />
<Box component="div" m={2}>
<Switch>
<Route exact path="/" component={YourDevices} />
<Routes>
<Route path="/" element={<YourDevices />} />
{AppState.info.isAdmin && (
<>
<Route exact path="/admin/all-devices" component={AllDevices} />
<Route path="/admin/all-devices" element={<AllDevices />} />
</>
)}
</Switch>
</Routes>
</Box>
</Router>
);
Expand Down
15 changes: 14 additions & 1 deletion website/src/components/AddDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ export const AddDevice = observer(class AddDevice extends React.Component<Props>
}

render() {

const handleClose = (event: any, reason: string) => {
if (reason === "backdropClick") {
return false;
}

if (reason === "escapeKeyDown") {
return false;
}

return true
};

return (
<>
<Card>
Expand Down Expand Up @@ -206,7 +219,7 @@ export const AddDevice = observer(class AddDevice extends React.Component<Props>
</form>
</CardContent>
</Card>
<Dialog disableBackdropClick disableEscapeKeyDown maxWidth="xl" open={this.dialogOpen}>
<Dialog disableEscapeKeyDown maxWidth="xl" open={this.dialogOpen} onClose={handleClose}>
<DialogTitle>
Get Connected
<Info>
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Devices = observer(class Devices extends React.Component {
return <p>loading...</p>;
}
return (
<Grid container spacing={3} justify="center">
<Grid container spacing={3} justifyContent="center">
<Grid item xs={12}>
<Grid container spacing={3}>
{this.devices.current.map((device, i) => (
Expand Down
Loading

0 comments on commit 494becf

Please sign in to comment.