-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove last-location * Upgrade react-router Fix upgrade * Fix router inside router error Co-authored-by: Aidan Grimshaw <grimshawaidan@gmail.com>
- Loading branch information
1 parent
67e72bc
commit f32c7c0
Showing
14 changed files
with
209 additions
and
368 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.