-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from stephin007/NEW-UI
STAGING DEPLOYMENT 16/06/2021
- Loading branch information
Showing
9 changed files
with
2,019 additions
and
1,888 deletions.
There are no files selected for viewing
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,20 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<title>CoWIN Vaccination Tracker</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
</body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta name="description" content="Web site created using create-react-app" /> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<title>CoWIN Vaccination Tracker</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
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,58 +1,53 @@ | ||
import React from "react"; | ||
import "./App.css"; | ||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | ||
|
||
import { ThemeProvider } from "styled-components"; | ||
import { useDarkMode } from "./components/useDarkMode"; | ||
import { lightTheme, darkTheme } from "./components/themes"; | ||
import { GlobalStyles } from "./components/globalStyles"; | ||
|
||
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles"; | ||
|
||
import Home from "./components/Home/Home"; | ||
import Header from "./components/Header/Header"; | ||
import About from "./components/About/About"; | ||
import Intro from "./components/Intro/Intro"; | ||
|
||
import CovidInfoMain from "./components/CovidInfo/CovidInfoMain"; | ||
import React from 'react'; | ||
import './App.css'; | ||
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import { useDarkMode } from './components/useDarkMode'; | ||
import { lightTheme, darkTheme } from './components/themes'; | ||
import { GlobalStyles } from './components/globalStyles'; | ||
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; | ||
import Home from './components/Home/Home'; | ||
import Header from './components/Header/Header'; | ||
import About from './components/About/About'; | ||
import Intro from './components/Intro/Intro'; | ||
import CovidInfoMain from './components/CovidInfo/CovidInfoMain'; | ||
|
||
const App = () => { | ||
const [theme, toggleTheme] = useDarkMode(); | ||
const themeMode = theme === "light" ? lightTheme : darkTheme; | ||
const appliedTheme = createMuiTheme({ | ||
palette: { | ||
type: theme === "light" ? "light" : "dark", | ||
}, | ||
}); | ||
|
||
return ( | ||
<ThemeProvider theme={themeMode}> | ||
<MuiThemeProvider theme={appliedTheme}> | ||
<> | ||
<GlobalStyles /> | ||
<Router> | ||
<div className="app"> | ||
<Header theme={theme} toggleTheme={toggleTheme} /> | ||
<Switch> | ||
<Route exact={true} path="/"> | ||
<Intro /> | ||
</Route> | ||
<Route path="/vaccines" exact={true}> | ||
<Home /> | ||
</Route> | ||
<Route path="/covidinfo" exact={true}> | ||
<CovidInfoMain /> | ||
</Route> | ||
<Route path="/about" exact={true}> | ||
<About /> | ||
</Route> | ||
</Switch> | ||
</div> | ||
</Router> | ||
</> | ||
</MuiThemeProvider> | ||
</ThemeProvider> | ||
); | ||
const [theme, toggleTheme] = useDarkMode(); | ||
const themeMode = theme === 'light' ? lightTheme : darkTheme; | ||
const appliedTheme = createMuiTheme({ | ||
palette: { | ||
type: theme === 'light' ? 'light' : 'dark', | ||
}, | ||
}); | ||
return ( | ||
<ThemeProvider theme={themeMode}> | ||
<MuiThemeProvider theme={appliedTheme}> | ||
<> | ||
<GlobalStyles /> | ||
<Router> | ||
<div className="app"> | ||
<Header theme={theme} toggleTheme={toggleTheme} /> | ||
<Switch> | ||
<Route exact={true} path="/"> | ||
<Intro /> | ||
</Route> | ||
<Route path="/vaccines" exact={true}> | ||
<Home /> | ||
</Route> | ||
<Route path="/covidinfo" exact={true}> | ||
<CovidInfoMain /> | ||
</Route> | ||
<Route path="/about" exact={true}> | ||
<About /> | ||
</Route> | ||
</Switch> | ||
</div> | ||
</Router> | ||
</> | ||
</MuiThemeProvider> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default App; |
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
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
Oops, something went wrong.