Skip to content

Commit

Permalink
Upgrade react router to v6 (#1016)
Browse files Browse the repository at this point in the history
* Remove last-location

* Upgrade react-router

Fix upgrade

* Fix router inside router error

Co-authored-by: Aidan Grimshaw <grimshawaidan@gmail.com>
  • Loading branch information
zakpatterson and thegrims committed May 27, 2022
1 parent 67e72bc commit f32c7c0
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 368 deletions.
199 changes: 45 additions & 154 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"react-hook-form": "^7.22.5",
"react-number-format": "^4.9.3",
"react-redux": "^8.0.2",
"react-router": "^5.3.1",
"react-router-dom": "^5.3.3",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-scripts": "^4.0.3",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
Expand Down
47 changes: 41 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
import { ReactElement } from 'react'
import { ReactElement, useMemo } from 'react'
import Main from './components/Main'
import './App.css'
import { createTheme, ThemeProvider, useMediaQuery } from '@material-ui/core'

const App = (): ReactElement => (
<div className="App">
<Main />
</div>
)
const App = (): ReactElement => {
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)')

const theme = useMemo(
() =>
createTheme({
palette: {
secondary: prefersDarkMode
? {
light: '#4f5b62',
main: '#d5d5d5',
dark: '#000a12',
contrastText: '#ffffff'
}
: {
light: '#4f5b62',
main: '#263238',
dark: '#000a12',
contrastText: '#ffffff'
},
primary: {
light: '#66ffa6',
main: '#00e676',
dark: '#00b248',
contrastText: '#000000'
}
}
}),
[prefersDarkMode]
)

return (
<div className="App">
<ThemeProvider theme={theme}>
<Main />
</ThemeProvider>
</div>
)
}

export default App
Loading

0 comments on commit f32c7c0

Please sign in to comment.