Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Issue #122 - Responsive UI #147

Open
wants to merge 17 commits into
base: NEW-UI
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.env

.env
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,7 @@
understand that this tool wouldn’t be useful if you couldn’t customize
it when you are ready for it.
</li>
<li><code>test</code>:
<ol>
<li> Start:- Run <i><code>npm test</code></i> from root of the project.</li>
<li>Update Snapshots:- To Update all failing snapshots run <i><code>npm run test:snap</code></i> from root of the project.</li>
<li>Test Coverage:- To get the test coverage run <i> <code> npm run test:cover</code></i> from root of the project.</li>
</ol>
</li>
<li><code>test</code>: Run tests using Jest</li>
</ul>
</li>
</ul>
Expand Down
101 changes: 46 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,48 @@
{
"name": "cowin",
"version": "0.1.0",
"private": true,
"dependencies": {
"@date-io/date-fns": "1.3.13",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/pickers": "^3.3.10",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"chart.js": "^3.3.2",
"date-fns": "^2.21.1",
"mapbox-gl": "^2.3.0",
"react": "^16.14.0",
"react-chartjs-2": "^3.0.3",
"react-dom": "^16.14.0",
"react-map-gl": "^6.1.15",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"styled-components": "^5.3.0",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"test:snap": "npm run test -- -u",
"test:cover": "npm test -- --coverage"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.6.2",
"react-test-renderer": "^17.0.2"
}
"name": "cowin",
"version": "0.1.0",
"private": true,
"dependencies": {
"@date-io/date-fns": "1.3.13",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/pickers": "^3.3.10",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"date-fns": "^2.21.1",
"mapbox-gl": "^2.3.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-map-gl": "^6.1.15",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"style-components": "^0.1.0",
"styled-components": "^5.3.0",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
31 changes: 17 additions & 14 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<!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>
96 changes: 48 additions & 48 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,53 +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 Header from "./components/Header/Header";
import About from "./components/About/About";
import Intro from "./components/Intro/Intro";
import { HomePage } from "./pages";

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}>
<HomePage />
</Route>
<Route path="/about" exact={true}>
<About />
</Route>
</Switch>
</div>
</Router>
</>
</MuiThemeProvider>
</ThemeProvider>
);
};

export default App;
3 changes: 0 additions & 3 deletions src/__tests__/__snapshots__/about.js.snap

This file was deleted.

5 changes: 0 additions & 5 deletions src/__tests__/__snapshots__/covidInfoMain.js.snap

This file was deleted.

3 changes: 0 additions & 3 deletions src/__tests__/__snapshots__/header.js.snap

This file was deleted.

3 changes: 0 additions & 3 deletions src/__tests__/__snapshots__/home.js.snap

This file was deleted.

3 changes: 0 additions & 3 deletions src/__tests__/__snapshots__/intro.js.snap

This file was deleted.

15 changes: 0 additions & 15 deletions src/__tests__/about.js

This file was deleted.

25 changes: 0 additions & 25 deletions src/__tests__/covidInfoMain.js

This file was deleted.

37 changes: 0 additions & 37 deletions src/__tests__/header.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/__tests__/home.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/__tests__/intro.js

This file was deleted.

Loading