From 96fe09cde2414cbd1bc8d7cabf6c7ac9af2bb94c Mon Sep 17 00:00:00 2001 From: Rachel RoseFigura Date: Mon, 23 Mar 2020 21:57:49 -0700 Subject: [PATCH 1/6] Add ESLint and prettier --- .eslintrc.js | 32 ++++++++++++++++++ .prettierignore | 28 +++++++++++++++ .prettierrc | 4 --- .prettierrc.js | 5 +++ package.json | 11 ++++-- yarn.lock | 90 ++++++++++++++++++++++++++++++++++++++++++++----- 6 files changed, 156 insertions(+), 14 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .prettierignore delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..b242c07e60 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,32 @@ +module.exports = { + env: { + browser: true, + es6: true, + }, + parser: 'babel-eslint', + extends: ['prettier', 'prettier/react', 'plugin:prettier/recommended'], + globals: { + Atomics: 'readonly', + SharedArrayBuffer: 'readonly', + }, + parserOptions: { + ecmaFeatures: { + jsx: true, + modules: true, + }, + ecmaVersion: 2018, + sourceType: 'module', + }, + plugins: ['react', 'prettier'], + rules: { + 'prettier/prettier': 'error', + 'react/jsx-filename-extension': [1, { extensions: ['.js'] }], + 'react/forbid-prop-types': [0, { forbid: ['any'] }], + 'react/prop-types': 0, + }, + env: { + jest: true, + browser: true, + node: true, + }, +}; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..b76d7fb251 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,28 @@ +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build +creds.sh +token.json + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# ides +.idea +.tern-port +.vscode/ \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index a20502b7f0..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all" -} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000..8c2cb14966 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + singleQuote: true, + trailingComma: 'all', + arrowParens: 'avoid', +}; diff --git a/package.json b/package.json index f6943b9d8e..7320a73f67 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,11 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "lint": "eslint src || printf '\\n\\e[31mRun lint-fix to fix\\e[0m\\n\\n'", + "lint-fix": "eslint --fix src", + "prettier": "prettier --check '**/*.{css,scss,js}' || printf '\\n\\e[31mRun prettier-fix to fix\\e[0m\\n\\n'", + "prettier-fix": "prettier --write '**/*.{css,scss,js}'" }, "eslintConfig": { "extends": "react-app" @@ -46,6 +50,9 @@ ] }, "devDependencies": { - "prettier": "1.19.1" + "eslint": "6.8.0", + "eslint-config-prettier": "6.10.1", + "eslint-plugin-prettier": "3.1.2", + "prettier": "2.0.2" } } diff --git a/yarn.lock b/yarn.lock index 5e8f10df9c..6b9137d85d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4099,6 +4099,13 @@ escodegen@^1.11.0, escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" +eslint-config-prettier@6.10.1: + version "6.10.1" + resolved "https://unpm.uberinternal.com/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a" + integrity sha1-Ep757FddXdwOJpZnvwne/NiYZCo= + dependencies: + get-stdin "^6.0.0" + eslint-config-react-app@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.0.tgz#135110ba56a9e378f7acfe5f36e2ae76a2317899" @@ -4173,6 +4180,13 @@ eslint-plugin-jsx-a11y@6.2.3: has "^1.0.3" jsx-ast-utils "^2.2.1" +eslint-plugin-prettier@3.1.2: + version "3.1.2" + resolved "https://unpm.uberinternal.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" + integrity sha1-Qy5aZnZmq4TOcvlFxy932Zalybo= + dependencies: + prettier-linter-helpers "^1.0.0" + eslint-plugin-react-hooks@^1.6.1: version "1.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04" @@ -4221,6 +4235,49 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== +eslint@6.8.0: + version "6.8.0" + resolved "https://unpm.uberinternal.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha1-YiYtZylzn5J1cjgkMC+yJ8jJP/s= + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.10.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^7.0.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.14" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.3" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" + table "^5.2.3" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + eslint@^6.6.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" @@ -4491,6 +4548,11 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://unpm.uberinternal.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha1-c+4RmC2Gyq95WYKNUZz+kn+sXwM= + fast-glob@^2.0.2: version "2.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" @@ -4896,6 +4958,11 @@ get-own-enumerable-property-symbols@^3.0.0: resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://unpm.uberinternal.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha1-ngm/cSs2CrkiXoEgSPcf3pyJZXs= + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -7188,10 +7255,10 @@ mkdirp@^1.0.3: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea" integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g== -momentjs@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/momentjs/-/momentjs-2.0.0.tgz#73df904b4fa418f6e3c605e831cef6ed5518ebd4" - integrity sha1-c9+QS0+kGPbjxgXoMc727VUY69Q= +moment@^2.24.0: + version "2.24.0" + resolved "https://unpm.uberinternal.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" + integrity sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s= move-concurrently@^1.0.1: version "1.0.1" @@ -8738,10 +8805,17 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://unpm.uberinternal.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha1-0j1B/hN1ZG3i0BBNNFSjAIgCz3s= + dependencies: + fast-diff "^1.1.2" + +prettier@2.0.2: + version "2.0.2" + resolved "https://unpm.uberinternal.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08" + integrity sha1-G6jz65IjHnabf818tzrhtrdK3gg= pretty-bytes@^5.1.0: version "5.3.0" From d96174f583ae148a00d257d26ae7c8e616e5e982 Mon Sep 17 00:00:00 2001 From: Rachel RoseFigura Date: Mon, 23 Mar 2020 22:00:02 -0700 Subject: [PATCH 2/6] lint --- cypress/integration/homepage.js | 20 ++-- cypress/plugins/index.js | 2 +- cypress/support/index.js | 2 +- get-data.js | 39 ++++--- scripts/resize-images.js | 15 ++- src/App.css | 18 ++- src/App.js | 2 +- src/assets/theme/overrides/index.js | 2 +- src/assets/theme/sizes.js | 2 +- src/assets/theme/typography.js | 16 +-- src/components/AppBar/AppBar.js | 14 +-- src/components/AppBar/AppBar.style.js | 52 ++++----- src/components/AppBar/Burger.js | 10 +- src/components/AppBar/MobileMenu.js | 8 +- src/components/Callout/Callout.js | 18 +-- src/components/Chart/Chart.js | 4 +- .../EndorsementCard/EndorsementCard.js | 14 ++- .../EndorsementCard/EndorsementCard.style.js | 5 +- src/components/Footer/Footer.js | 8 +- src/components/Footer/Footer.style.js | 3 +- src/components/Header/Header.js | 2 +- src/components/Newsletter/Newsletter.js | 10 +- src/components/Newsletter/Newsletter.style.js | 3 +- src/enums/endorsers.js | 10 +- src/enums/team.js | 109 +++++++++--------- src/index.css | 2 +- src/screens/About/About.js | 109 ++++++++++++++---- src/screens/Contact/Contact.js | 23 ++-- src/screens/Endorsements/Endorsements.js | 7 +- .../Endorsements/Endorsements.style.js | 3 +- src/screens/FAQ/FAQ.js | 5 +- src/screens/HomePage/HomePage.js | 32 +++-- src/screens/ModelPage/ModelPage.style.js | 13 +-- src/serviceWorker.js | 12 +- src/utils/model.js | 18 +-- 35 files changed, 357 insertions(+), 255 deletions(-) diff --git a/cypress/integration/homepage.js b/cypress/integration/homepage.js index 15f4cf262b..f2ecdbb936 100644 --- a/cypress/integration/homepage.js +++ b/cypress/integration/homepage.js @@ -1,14 +1,10 @@ describe('Main App Should be Visible', () => { - beforeEach(() => { - cy.visit('/') - cy.get('#root') - .should('be.visible') - }) + beforeEach(() => { + cy.visit('/'); + cy.get('#root').should('be.visible'); + }); - it(`Can See Map`, () => { - cy.get('.us-state-map') - .should('be.visible') - }) - - -}) + it(`Can See Map`, () => { + cy.get('.us-state-map').should('be.visible'); + }); +}); diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index aa9918d215..8dd144a6c1 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -18,4 +18,4 @@ module.exports = (on, config) => { // `on` is used to hook into various events Cypress emits // `config` is the resolved Cypress config -} +}; diff --git a/cypress/support/index.js b/cypress/support/index.js index d68db96df2..37a498fb5b 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/get-data.js b/get-data.js index 5dc7a91e45..d47aac31f0 100644 --- a/get-data.js +++ b/get-data.js @@ -1,6 +1,6 @@ const fs = require('fs'); const readline = require('readline'); -const { google } = require("googleapis"); +const { google } = require('googleapis'); let MODELS = [ 'MAIN MODEL - Current Trends', @@ -39,9 +39,12 @@ fs.readFile('credentials.json', (err, content) => { * @param {function} callback The callback to call with the authorized client. */ function authorize(credentials, callback) { - const {client_secret, client_id, redirect_uris} = credentials.installed; + const { client_secret, client_id, redirect_uris } = credentials.installed; const oAuth2Client = new google.auth.OAuth2( - client_id, client_secret, redirect_uris[0]); + client_id, + client_secret, + redirect_uris[0], + ); // Check if we have previously stored a token. fs.readFile(TOKEN_PATH, (err, token) => { @@ -67,13 +70,17 @@ function getNewToken(oAuth2Client, callback) { input: process.stdin, output: process.stdout, }); - rl.question('Enter the code from that page here: ', (code) => { + rl.question('Enter the code from that page here: ', code => { rl.close(); oAuth2Client.getToken(code, (err, token) => { - if (err) return console.error('Error while trying to retrieve access token', err); + if (err) + return console.error( + 'Error while trying to retrieve access token', + err, + ); oAuth2Client.setCredentials(token); // Store the token to disk for later program executions - fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => { + fs.writeFile(TOKEN_PATH, JSON.stringify(token), err => { if (err) return console.error(err); console.log('Token stored to', TOKEN_PATH); }); @@ -89,18 +96,22 @@ function getNewToken(oAuth2Client, callback) { */ function downloadModel(auth, location, model) { - const sheets = google.sheets({version: 'v4', auth}); + const sheets = google.sheets({ version: 'v4', auth }); sheets.spreadsheets.values.get( { - spreadsheetId: "1YEj4Vr6lG1jQ1R3LG6frijJYNynKcgTjzo2n0FsBwZA", - range: `${MODELS[model]}!C19:U92` + spreadsheetId: '1YEj4Vr6lG1jQ1R3LG6frijJYNynKcgTjzo2n0FsBwZA', + range: `${MODELS[model]}!C19:U92`, }, (err, res) => { - if (err) return console.log("The API returned an error: " + err); + if (err) return console.log('The API returned an error: ' + err); const rows = res.data.values; - fs.writeFile(`public/data/${location}.${model}.json`, JSON.stringify(rows), err => { - if (err) return console.error(err); - }); - } + fs.writeFile( + `public/data/${location}.${model}.json`, + JSON.stringify(rows), + err => { + if (err) return console.error(err); + }, + ); + }, ); } diff --git a/scripts/resize-images.js b/scripts/resize-images.js index 8526a892ea..3de7301acc 100644 --- a/scripts/resize-images.js +++ b/scripts/resize-images.js @@ -1,18 +1,21 @@ -const fs = require('fs'); -const util = require('util'); -const path = require('path'); +const fs = require('fs'); +const util = require('util'); +const path = require('path'); const sharp = require('sharp'); // Resize images to constant width / height // removing resized images: find public/images/endorsers -regex ".*resized.*" -delete -(async() => { +(async () => { const width = 100; const height = 100; - const imageFolder = 'endorsers' + const imageFolder = 'endorsers'; try { const readdirAsync = util.promisify(fs.readdir); - const directoryPath = path.join(__dirname, `../public/images/${imageFolder}`); + const directoryPath = path.join( + __dirname, + `../public/images/${imageFolder}`, + ); const files = await readdirAsync(directoryPath); diff --git a/src/App.css b/src/App.css index e7c25a1346..15f415d29c 100644 --- a/src/App.css +++ b/src/App.css @@ -1,21 +1,20 @@ .graphs-container { - } -.small-graph -{ - float:left; +.small-graph { + float: left; width: 50%; } .clear { - clear:both; + clear: both; } h4 { margin-top: 50px; } -th, td { +th, +td { padding: 10px; width: 25%; } @@ -24,15 +23,14 @@ tr { } @media only screen and (max-width: 600px) { - .small-graph - { + .small-graph { float: unset; width: 100%; } } .analysis-group { - background-color: "#fafafa"; + background-color: '#fafafa'; padding: 20; margin-top: 20; } @@ -71,6 +69,6 @@ tr { } .Map path:hover { - opacity: 0.50; + opacity: 0.5; cursor: pointer; } diff --git a/src/App.js b/src/App.js index 3af4581538..3d0a05cc51 100644 --- a/src/App.js +++ b/src/App.js @@ -9,7 +9,7 @@ import HomePage from 'screens/HomePage/HomePage'; import FAQ from 'screens/FAQ/FAQ'; import Contact from 'screens/Contact/Contact'; import Endorsements from 'screens/Endorsements/Endorsements'; -import About from 'screens/About/About' +import About from 'screens/About/About'; import AppBar from 'components/AppBar/AppBar'; import Footer from 'components/Footer/Footer'; import theme from 'assets/theme'; diff --git a/src/assets/theme/overrides/index.js b/src/assets/theme/overrides/index.js index c44c0405fe..016840e923 100644 --- a/src/assets/theme/overrides/index.js +++ b/src/assets/theme/overrides/index.js @@ -9,5 +9,5 @@ export default { MuiIconButton, MuiPaper, MuiTableCell, - MuiTableHead + MuiTableHead, }; diff --git a/src/assets/theme/sizes.js b/src/assets/theme/sizes.js index 123663ae45..fe58ac30a9 100644 --- a/src/assets/theme/sizes.js +++ b/src/assets/theme/sizes.js @@ -3,5 +3,5 @@ export const materialSMBreakpoint = '600px'; export default { mobileBreakpoint, - materialSMBreakpoint + materialSMBreakpoint, }; diff --git a/src/assets/theme/typography.js b/src/assets/theme/typography.js index fb5cd9ec83..a8a3362d19 100644 --- a/src/assets/theme/typography.js +++ b/src/assets/theme/typography.js @@ -41,20 +41,20 @@ export default { color: palette.text.primary, fontSize: '16px', letterSpacing: '-0.05px', - lineHeight: '25px' + lineHeight: '25px', }, subtitle2: { color: palette.text.secondary, fontWeight: 400, fontSize: '14px', letterSpacing: '-0.05px', - lineHeight: '21px' + lineHeight: '21px', }, body1: { color: palette.text.primary, fontSize: '0.9rem', letterSpacing: '-0.05px', - lineHeight: '21px' + lineHeight: '21px', }, body2: { color: palette.text.secondary, @@ -63,20 +63,20 @@ export default { fontSize: '1rem', }, letterSpacing: '-0.04px', - lineHeight: '1.4rem' + lineHeight: '1.4rem', }, whiteText: { color: palette.white, }, button: { color: palette.text.primary, - fontSize: '14px' + fontSize: '14px', }, caption: { color: palette.text.secondary, fontSize: '11px', letterSpacing: '0.33px', - lineHeight: '13px' + lineHeight: '13px', }, overline: { color: palette.text.secondary, @@ -84,6 +84,6 @@ export default { fontWeight: 500, letterSpacing: '0.33px', lineHeight: '13px', - textTransform: 'uppercase' - } + textTransform: 'uppercase', + }, }; diff --git a/src/components/AppBar/AppBar.js b/src/components/AppBar/AppBar.js index b9ebb0cfba..5af092d1e1 100644 --- a/src/components/AppBar/AppBar.js +++ b/src/components/AppBar/AppBar.js @@ -1,10 +1,10 @@ -import React, { useState } from 'react'; +import React, { useState } from 'react'; import { useHistory, useLocation, matchPath, Link } from 'react-router-dom'; -import { ArrowBack } from '@material-ui/icons'; -import Typography from '@material-ui/core/Typography'; -import Logo from 'assets/images/logo'; -import MobileMenu from './MobileMenu'; -import Burger from './Burger'; +import { ArrowBack } from '@material-ui/icons'; +import Typography from '@material-ui/core/Typography'; +import Logo from 'assets/images/logo'; +import MobileMenu from './MobileMenu'; +import Burger from './Burger'; import { Wrapper, Left, @@ -51,7 +51,7 @@ const _AppBar = () => { window.scrollTo(0, 0); }; - const shareURL = `https://covidactnow.org${match ? match.url : '' }`; + const shareURL = `https://covidactnow.org${match ? match.url : ''}`; const hashtag = 'COVIDActNow'; const stateShareTitle = `This is the point of no return for intervention to prevent ${locationName}'s hospital system from being overloaded by Coronavirus: `; const defaultShareTitle = diff --git a/src/components/AppBar/AppBar.style.js b/src/components/AppBar/AppBar.style.js index e9e06830e7..2e607e1f4b 100644 --- a/src/components/AppBar/AppBar.style.js +++ b/src/components/AppBar/AppBar.style.js @@ -1,19 +1,18 @@ import styled from 'styled-components'; import AppBar from '@material-ui/core/AppBar'; -import Tabs from '@material-ui/core/Tabs'; -import Tab from '@material-ui/core/Tab'; +import Tabs from '@material-ui/core/Tabs'; +import Tab from '@material-ui/core/Tab'; import palette from 'assets/theme/palette'; import { mobileBreakpoint } from 'assets/theme/sizes'; - -export const Wrapper = styled.div ` +export const Wrapper = styled.div` display: flex; justify-content: space-between; height: 64px; padding: 0 20px; - @media(min-width: ${mobileBreakpoint}) { + @media (min-width: ${mobileBreakpoint}) { padding: 0 20px; } `; @@ -23,7 +22,7 @@ export const StyledAppBar = styled(AppBar)` border-bottom: 1px solid #e3e3e3; `; -export const Left = styled.div ` +export const Left = styled.div` display: flex; justify-content: space-between; align-items: center; @@ -38,21 +37,17 @@ export const Left = styled.div ` } `; -export const StyledDesktopMenu = styled(Tabs) -` +export const StyledDesktopMenu = styled(Tabs)` display: none; - @media(min-width: ${mobileBreakpoint}) { - display: inline-block; + @media (min-width: ${mobileBreakpoint}) { + display: inline-block; } `; -export const StyledTabs = styled(Tabs) -` -`; +export const StyledTabs = styled(Tabs)``; -export const StyledTab = styled(Tab) -` +export const StyledTab = styled(Tab)` min-width: 36px; height: 64px; margin-left: 15px; @@ -74,12 +69,11 @@ export const StyledTab = styled(Tab) } `; - -export const MenuTitle = styled.div ` +export const MenuTitle = styled.div` display: inline-block; `; -export const StyledBurger = styled.button ` +export const StyledBurger = styled.button` position: relative; top: 15px; margin-left: 20px; @@ -101,39 +95,39 @@ export const StyledBurger = styled.button ` div { width: 2rem; height: 0.25rem; - background: ${({ open }) => open ? '#0D0C1D' : '#000000'}; + background: ${({ open }) => (open ? '#0D0C1D' : '#000000')}; border-radius: 10px; position: relative; transform-origin: 1px; :first-child { - transform: ${({ open }) => open ? 'rotate(45deg)' : 'rotate(0)'}; + transform: ${({ open }) => (open ? 'rotate(45deg)' : 'rotate(0)')}; } :nth-child(2) { - opacity: ${({ open }) => open ? '0' : '1'}; - transform: ${({ open }) => open ? 'translateX(20px)' : 'translateX(0)'}; + opacity: ${({ open }) => (open ? '0' : '1')}; + transform: ${({ open }) => (open ? 'translateX(20px)' : 'translateX(0)')}; } :nth-child(3) { - transform: ${({ open }) => open ? 'rotate(-45deg)' : 'rotate(0)'}; + transform: ${({ open }) => (open ? 'rotate(-45deg)' : 'rotate(0)')}; } } `; -export const StyledMobileMenu = styled.nav ` +export const StyledMobileMenu = styled.nav` display: inherit; - @media(min-width: ${mobileBreakpoint}) { + @media (min-width: ${mobileBreakpoint}) { display: none; } `; -export const StyledMenu = styled.nav ` +export const StyledMenu = styled.nav` display: flex; flex-direction: column; background: white; border-top: 1px solid #e3e3e3; - transform: ${({ open }) => open ? 'translateY(64px)' : 'translateY(-100%)'}; + transform: ${({ open }) => (open ? 'translateY(64px)' : 'translateY(-100%)')}; height: 100vh; text-align: left; padding: 1rem 2rem 0; @@ -146,9 +140,9 @@ export const StyledMenu = styled.nav ` cursor: pointer; font-size: 2rem; padding: 1.5rem 0; - color: #0D0C1D; + color: #0d0c1d; text-decoration: none; } `; -export const Content = styled.div ``; +export const Content = styled.div``; diff --git a/src/components/AppBar/Burger.js b/src/components/AppBar/Burger.js index 9d9f81758c..72e60aa25d 100644 --- a/src/components/AppBar/Burger.js +++ b/src/components/AppBar/Burger.js @@ -1,16 +1,14 @@ import React from 'react'; -import { - StyledBurger, -} from './AppBar.style'; +import { StyledBurger } from './AppBar.style'; -const Burger = ({ open, setOpen}) => { +const Burger = ({ open, setOpen }) => { return ( setOpen(!open)}>
- ) -} + ); +}; export default Burger; diff --git a/src/components/AppBar/MobileMenu.js b/src/components/AppBar/MobileMenu.js index ece790cacc..fb2669c65e 100644 --- a/src/components/AppBar/MobileMenu.js +++ b/src/components/AppBar/MobileMenu.js @@ -1,7 +1,5 @@ import React from 'react'; -import { - StyledMenu, -} from './AppBar.style'; +import { StyledMenu } from './AppBar.style'; const MobileMenu = ({ open, goTo }) => { return ( @@ -22,7 +20,7 @@ const MobileMenu = ({ open, goTo }) => { Contact - ) -} + ); +}; export default MobileMenu; diff --git a/src/components/Callout/Callout.js b/src/components/Callout/Callout.js index 70dfa14aec..642eadf322 100644 --- a/src/components/Callout/Callout.js +++ b/src/components/Callout/Callout.js @@ -1,7 +1,5 @@ import React from 'react'; -import { - StyledCallout, -} from './Callout.style'; +import { StyledCallout } from './Callout.style'; const Callout = ({ children, @@ -9,13 +7,15 @@ const Callout = ({ borderColor = '#e3e3e3', }) => { return ( - + {children} - ) -} + ); +}; export default Callout; diff --git a/src/components/Chart/Chart.js b/src/components/Chart/Chart.js index afd3026950..cc2633e992 100644 --- a/src/components/Chart/Chart.js +++ b/src/components/Chart/Chart.js @@ -54,7 +54,7 @@ const Chart = ({ state, subtitle, data, dateOverwhelmed }) => { }, }, tooltip: { - formatter: function() { + formatter: function () { const date = moment(this.x).format('MMMM D'); const beds = this.y.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); if (this.series.userOptions.type === 'line') { @@ -68,7 +68,7 @@ const Chart = ({ state, subtitle, data, dateOverwhelmed }) => { step: 7, labels: { rotation: -45, - formatter: function() { + formatter: function () { return dateFormat('%b %e', this.value); }, }, diff --git a/src/components/EndorsementCard/EndorsementCard.js b/src/components/EndorsementCard/EndorsementCard.js index ed3c5c406b..602b7fc162 100644 --- a/src/components/EndorsementCard/EndorsementCard.js +++ b/src/components/EndorsementCard/EndorsementCard.js @@ -28,14 +28,24 @@ const EndorsementCard = ({ window.open(profileUrl, '_blank')} - avatar={} + avatar={ + + } title={name} /> {credentials.map((c, index) => ( - + {c} ))} diff --git a/src/components/EndorsementCard/EndorsementCard.style.js b/src/components/EndorsementCard/EndorsementCard.style.js index d5f214755e..b083d38ccf 100644 --- a/src/components/EndorsementCard/EndorsementCard.style.js +++ b/src/components/EndorsementCard/EndorsementCard.style.js @@ -31,8 +31,7 @@ export const Credential = styled(Typography)` font-size: 0.9rem; `; -export const Left = styled.div` -`; +export const Left = styled.div``; export const Quote = styled.div` background-color: white; @@ -43,7 +42,7 @@ export const Quote = styled.div` padding: 24px; p { - font-size: 13px + font-size: 13px; } @media (min-width: 600px) { diff --git a/src/components/Footer/Footer.js b/src/components/Footer/Footer.js index 4196e71f11..e3a85ce7c2 100644 --- a/src/components/Footer/Footer.js +++ b/src/components/Footer/Footer.js @@ -1,5 +1,5 @@ import React from 'react'; -import Logo from 'assets/images/logo'; +import Logo from 'assets/images/logo'; import { useHistory } from 'react-router-dom'; @@ -39,7 +39,11 @@ const Footer = ({ children }) => {
- Press contact: press@covidactnow.org
Contribute to this tool + Press contact:{' '} + press@covidactnow.org +
+ Contribute to this + tool
diff --git a/src/components/Footer/Footer.style.js b/src/components/Footer/Footer.style.js index c9ca329781..e8563a3c55 100644 --- a/src/components/Footer/Footer.style.js +++ b/src/components/Footer/Footer.style.js @@ -31,7 +31,6 @@ export const StyledFooterBodyLinks = styled.div` margin: 0 0 1.5rem; } - @media (min-width: 600px) { flex: 0 0 40%; padding: 3rem 0; @@ -70,7 +69,7 @@ export const StyledFooterHeader = styled.div` height: 65px; } - @media(min-width: 600px) { + @media (min-width: 600px) { padding: 0 4rem; } diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 8b8a441b0a..fe0184bc75 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -9,7 +9,7 @@ const Header = ({ children, locationName }) => { - Why you must act now{locationName? `: ${locationName}` : ''} + Why you must act now{locationName ? `: ${locationName}` : ''} Public leaders & health officials: diff --git a/src/components/Newsletter/Newsletter.js b/src/components/Newsletter/Newsletter.js index 0953731ad0..64e2181ce3 100644 --- a/src/components/Newsletter/Newsletter.js +++ b/src/components/Newsletter/Newsletter.js @@ -4,7 +4,15 @@ import { StyledNewsletter } from './Newsletter.style'; const Newsletter = () => { return ( - + ); }; diff --git a/src/components/Newsletter/Newsletter.style.js b/src/components/Newsletter/Newsletter.style.js index 1ba297c723..a5278e46ac 100644 --- a/src/components/Newsletter/Newsletter.style.js +++ b/src/components/Newsletter/Newsletter.style.js @@ -4,9 +4,8 @@ export const StyledNewsletter = styled.div` iframe { min-height: 350px; - @media(min-width: 600px) { + @media (min-width: 600px) { min-height: 270px; } } `; - diff --git a/src/enums/endorsers.js b/src/enums/endorsers.js index 9c910be849..d9efafbc3f 100644 --- a/src/enums/endorsers.js +++ b/src/enums/endorsers.js @@ -11,12 +11,12 @@ export default [ }, { size: 4, - name: 'Valerie Nurr\'araaluk Davidson', + name: "Valerie Nurr'araaluk Davidson", avatarUrl: '/images/endorsers/Valerie-Davidson-A__resized-100-100.jpg', profileUrl: 'https://en.wikipedia.org/wiki/Valerie_Davidson', credentials: [ 'Former Commissioner of the Alaska Department of Health and Social Services', - 'Founder\'s Council member, United States of Care', + "Founder's Council member, United States of Care", ], }, { @@ -39,16 +39,14 @@ export default [ 'Professor of Health Services, Policy and Practice, Brown University', ], quote: - 'This model offers a great tool for state policy staff who\'s job it is to advise the Governor and the Director of Health regarding what kinds of policies should be instituted to encourage social distancing to minimize contagion with corona virus. Staff need to be prepared to defend with comparative data their recommendations regarding whether to close schools, close bars, restrict gatherings to a select number or encourage non-essential workers to telecommute. This web site offers state specific estimates that demonstrate the impact of such policies on the curve of infections, hospitalizations and deaths in a very sophisticated manner.', + "This model offers a great tool for state policy staff who's job it is to advise the Governor and the Director of Health regarding what kinds of policies should be instituted to encourage social distancing to minimize contagion with corona virus. Staff need to be prepared to defend with comparative data their recommendations regarding whether to close schools, close bars, restrict gatherings to a select number or encourage non-essential workers to telecommute. This web site offers state specific estimates that demonstrate the impact of such policies on the curve of infections, hospitalizations and deaths in a very sophisticated manner.", }, { size: 4, name: 'Ben Goldman-Israelow, MD, PhD', avatarUrl: '/images/endorsers/ben_goldman_israelow__resized-100-100.jpeg', profileUrl: 'https://medicine.yale.edu/profile/benjamin_goldman-israelow/', - credentials: [ - 'Infectious Disease Fellow, Yale School of Medicine', - ], + credentials: ['Infectious Disease Fellow, Yale School of Medicine'], }, { size: 4, diff --git a/src/enums/team.js b/src/enums/team.js index ef2ae04ec7..ae4cdf41bb 100644 --- a/src/enums/team.js +++ b/src/enums/team.js @@ -1,92 +1,93 @@ export default [ { - name: "Max Henderson", - title: "ex-Firebase/Google Executive", - link: "https://www.linkedin.com/in/maxhenderson/", + name: 'Max Henderson', + title: 'ex-Firebase/Google Executive', + link: 'https://www.linkedin.com/in/maxhenderson/', }, { - name: "Representative Jonathan Kreiss-Tomkins", - title: "Alaska Legislature", - link: "https://en.wikipedia.org/wiki/Jonathan_Kreiss-Tomkins", + name: 'Representative Jonathan Kreiss-Tomkins', + title: 'Alaska Legislature', + link: 'https://en.wikipedia.org/wiki/Jonathan_Kreiss-Tomkins', }, { - name: "Igor Kofman", - title: "ex-CTO, Dropbox Paper", - link: "https://twitter.com/igorkofman", + name: 'Igor Kofman', + title: 'ex-CTO, Dropbox Paper', + link: 'https://twitter.com/igorkofman', }, { - name: "Nirav R. Shah", - title: "MD, MPH, senior scholar, Stanford University Clinical Excellence Research Center", - link: "https://profiles.stanford.edu/nirav-shah", + name: 'Nirav R. Shah', + title: + 'MD, MPH, senior scholar, Stanford University Clinical Excellence Research Center', + link: 'https://profiles.stanford.edu/nirav-shah', }, { - name: "Zack Rosen", - title: "CEO, Pantheon", - link: "https://www.linkedin.com/in/zacharyrosen/", + name: 'Zack Rosen', + title: 'CEO, Pantheon', + link: 'https://www.linkedin.com/in/zacharyrosen/', }, { - name: "James Tamplin", - title: "Founder/CEO, Firebase", - link: "https://www.linkedin.com/in/jamest/", + name: 'James Tamplin', + title: 'Founder/CEO, Firebase', + link: 'https://www.linkedin.com/in/jamest/', }, { - name: "Stephen Fiskell", - title: "Founder, Commonbook.me", - link: "https://www.linkedin.com/in/takemoreaction/", + name: 'Stephen Fiskell', + title: 'Founder, Commonbook.me', + link: 'https://www.linkedin.com/in/takemoreaction/', }, { - name: "Zack Rosen", - title: "Engineering Lead, Stitch Labs", - link: "https://www.linkedin.com/in/zack-rosen-a03abb3a/", + name: 'Zack Rosen', + title: 'Engineering Lead, Stitch Labs', + link: 'https://www.linkedin.com/in/zack-rosen-a03abb3a/', }, { - name: "David Strauss", - title: "CTO, Pantheon", - link: "https://twitter.com/davidstrauss?lang=en", + name: 'David Strauss', + title: 'CTO, Pantheon', + link: 'https://twitter.com/davidstrauss?lang=en', }, { - name: "Ali Berlin Johnson", - title: "Ex Lead Designer, Firebase", - link: "https://www.linkedin.com/in/berlinjohnson/", + name: 'Ali Berlin Johnson', + title: 'Ex Lead Designer, Firebase', + link: 'https://www.linkedin.com/in/berlinjohnson/', }, { - name: "Misha Chellam", - title: "Council on Society & Technology", - link: "https://www.linkedin.com/in/mishachellam/", + name: 'Misha Chellam', + title: 'Council on Society & Technology', + link: 'https://www.linkedin.com/in/mishachellam/', }, { - name: "Jacob Redding", - title: "Sr Principal, Accenture", - link: "https://www.linkedin.com/in/jacobredding/", + name: 'Jacob Redding', + title: 'Sr Principal, Accenture', + link: 'https://www.linkedin.com/in/jacobredding/', }, { - name: "Joseph Ensminger", - title: "Founder, J.E. Consulting", - link: "https://www.linkedin.com/in/josephensminger/", + name: 'Joseph Ensminger', + title: 'Founder, J.E. Consulting', + link: 'https://www.linkedin.com/in/josephensminger/', }, { - name: "Simon Frid", - title: "Founder, Fridiculous Ventures", - link: "https://www.linkedin.com/in/simonfrid/", + name: 'Simon Frid', + title: 'Founder, Fridiculous Ventures', + link: 'https://www.linkedin.com/in/simonfrid/', }, { - name: "Virsaviya Efraim", - title: "Software Engineer, Almanac", - link: "https://www.linkedin.com/in/virsaviyaefraim/", + name: 'Virsaviya Efraim', + title: 'Software Engineer, Almanac', + link: 'https://www.linkedin.com/in/virsaviyaefraim/', }, { - name: "Andrew Krackov", - title: "President, Hillcrest Advisory", - link: "https://www.linkedin.com/in/andykrackov/", + name: 'Andrew Krackov', + title: 'President, Hillcrest Advisory', + link: 'https://www.linkedin.com/in/andykrackov/', }, { - name: "Adnan Pirzada", - title: "Software Engineer, Lattice", - link: "https://www.linkedin.com/in/adpirz/", + name: 'Adnan Pirzada', + title: 'Software Engineer, Lattice', + link: 'https://www.linkedin.com/in/adpirz/', }, { - name: "Rachel RoseFigura", - title: "Software Engineer, Uber", - link: "https://www.linkedin.com/in/rachelrosefigura/", + name: 'Rachel RoseFigura', + title: 'Software Engineer, Uber', + link: 'https://www.linkedin.com/in/rachelrosefigura/', }, ]; diff --git a/src/index.css b/src/index.css index 18c3176e8d..e1da81b889 100644 --- a/src/index.css +++ b/src/index.css @@ -9,7 +9,7 @@ body { } html { - overflow-x: hidden; + overflow-x: hidden; } code { diff --git a/src/screens/About/About.js b/src/screens/About/About.js index a6307c91c3..ea5504221a 100644 --- a/src/screens/About/About.js +++ b/src/screens/About/About.js @@ -13,10 +13,18 @@ const About = ({ children }) => { About - CovidActNow.org was created by a team of data scientists, engineers, and designers in partnership with epidemiologists, public health officials, and political leaders to help understand how the COVID-19 pandemic will affect their region. + + CovidActNow.org + {' '} + was created by a team of data scientists, engineers, and designers in + partnership with epidemiologists, public health officials, and + political leaders to help understand how the COVID-19 pandemic will + affect their region. - This tool is built to enable political leaders to quickly make decisions in their Coronavirus response informed by best available data and modeling. + This tool is built to enable political leaders to quickly make + decisions in their Coronavirus response informed by best available + data and modeling. We built this tool to answer critically important questions such as: @@ -26,40 +34,79 @@ const About = ({ children }) => {
  • What will the impact be in my region be and when can I expect it?
  • +
  • How long until my hospital system is under severe pressure?
  • - How long until my hospital system is under severe pressure? -
  • -
  • - What is my menu of interventions, and how will they address the spread of Coronavirus? + What is my menu of interventions, and how will they address the + spread of Coronavirus?
  • -
    + Who built this tool? - CoVidActNow was founded by Max Henderson, Rep Jonathan Kreiss-Tomkins, Igor Kofman, and Zack Rosen, with medical and policy guidance from Nirav R. Shah (MD, MPH, senior scholar, Stanford University Clinical Excellence Research Center). + CoVidActNow was founded by{' '} + Max Henderson,{' '} + + Rep Jonathan Kreiss-Tomkins + + , Igor Kofman, and{' '} + Zack Rosen, + with medical and policy guidance from{' '} + Nirav R. Shah{' '} + (MD, MPH, senior scholar, Stanford University Clinical Excellence + Research Center). We have since grown into a large distributed team: -
      - {TEAM.map(teammate => { return
    • - {teammate.name} {" "}{teammate.title} -
    • }) - } -
    +
    - Our work has been validated and endorsed by a number of experts in epidemiology, public health, and medicine. + Our work has been{' '} + + validated and endorsed + {' '} + by a number of experts in epidemiology, public health, and medicine. - Our model is public. + + Our model is public. + - So are our assumptions and definitions. + + So are our assumptions and definitions. + @@ -67,18 +114,30 @@ const About = ({ children }) => { - We built covidactnow.org to solve an urgent problem: If we try to fight COVID in the present we will lose (e.g., Italy). We can only beat COVID by understanding what it will do to us in the near future. + We built covidactnow.org to{' '} + + solve an urgent problem: + {' '} + If we try to fight COVID in the present we will lose (e.g., Italy). We + can only beat COVID by understanding what it will do to us in the near + future. - Coronavirus response leaders need the tools to do this — we are building them the tools. + Coronavirus response leaders need the tools to do this — we are + building them the tools. Can I contribute? - Yes. To improve the capability and accuracy of the tool, we need the help of: + Yes. To improve the capability and accuracy of the tool, we need the + help of:
      @@ -109,7 +168,15 @@ const About = ({ children }) => {
    - Email us to share feedback or access to expertise, questions, or if you otherwise want to help. + + Email us + {' '} + to share feedback or access to expertise, questions, or if you + otherwise want to help.
    diff --git a/src/screens/Contact/Contact.js b/src/screens/Contact/Contact.js index c9660b8424..eb39b56943 100644 --- a/src/screens/Contact/Contact.js +++ b/src/screens/Contact/Contact.js @@ -1,11 +1,7 @@ import React from 'react'; import Typography from '@material-ui/core/Typography'; -import { - Wrapper, - Content, - StyledContactLink, -} from './Contact.style'; +import { Wrapper, Content, StyledContactLink } from './Contact.style'; const Contact = ({ children }) => { return ( @@ -20,16 +16,16 @@ const Contact = ({ children }) => { Medical Organizations: - + Government Agencies: - + @@ -38,7 +34,10 @@ const Contact = ({ children }) => { press@covidactnow.org
    - Our presskit is available here + Our presskit is available{' '} + + here +
    diff --git a/src/screens/Endorsements/Endorsements.js b/src/screens/Endorsements/Endorsements.js index 5ffb70378e..4eec8d93d7 100644 --- a/src/screens/Endorsements/Endorsements.js +++ b/src/screens/Endorsements/Endorsements.js @@ -24,7 +24,12 @@ const Endorsements = () => { must make now. - + {ENDORSERS.map((e, index) => ( diff --git a/src/screens/Endorsements/Endorsements.style.js b/src/screens/Endorsements/Endorsements.style.js index ebb779cf23..1dd03b74a1 100644 --- a/src/screens/Endorsements/Endorsements.style.js +++ b/src/screens/Endorsements/Endorsements.style.js @@ -53,5 +53,4 @@ export const Quote = styled.div` } `; -export const EndorsersWrapper = styled(Grid)` -`; +export const EndorsersWrapper = styled(Grid)``; diff --git a/src/screens/FAQ/FAQ.js b/src/screens/FAQ/FAQ.js index 0c73960893..836e62022b 100644 --- a/src/screens/FAQ/FAQ.js +++ b/src/screens/FAQ/FAQ.js @@ -12,7 +12,10 @@ const FAQ = ({ children }) => { - The model is public, and can be viewed here. Reference materials, including assumptions, logic, and definitions are available here. + The model is public, and{' '} + can be viewed here. Reference + materials, including assumptions, logic, and definitions{' '} + are available here. What are the current limitations of the model? diff --git a/src/screens/HomePage/HomePage.js b/src/screens/HomePage/HomePage.js index 8fb11d98f6..598784dc88 100644 --- a/src/screens/HomePage/HomePage.js +++ b/src/screens/HomePage/HomePage.js @@ -1,15 +1,12 @@ import React from 'react'; -import Typography from '@material-ui/core/Typography'; +import Typography from '@material-ui/core/Typography'; import Header from 'components/Header/Header'; import Map from 'components/Map/Map'; import Endorsements from 'screens/Endorsements/Endorsements'; -import Newsletter from "components/Newsletter/Newsletter" +import Newsletter from 'components/Newsletter/Newsletter'; -import { - Wrapper, - Content, -} from './HomePage.style'; +import { Wrapper, Content } from './HomePage.style'; export default function HomePage() { return ( @@ -19,7 +16,13 @@ export default function HomePage() {

    Click the map to see projections for your state.

    -
    +
    @@ -29,7 +32,11 @@ export default function HomePage() { How to use this tool - + This tool is built to enable political leaders to quickly make decisions in their Coronavirus response informed by best available data and modeling. @@ -38,9 +45,12 @@ export default function HomePage() { Here are the questions we built this tool to answer:
    1. - What will the impact be in my region be and when can I expect it? + What will the impact be in my region be and when can I expect + it? +
    2. +
    3. + How long until my hospital system is under severe pressure?
    4. -
    5. How long until my hospital system is under severe pressure?
    6. What are my menu of interventions, and how will they address the spread of Coronavirus? @@ -51,7 +61,7 @@ export default function HomePage() { Endorsements -
      +
      diff --git a/src/screens/ModelPage/ModelPage.style.js b/src/screens/ModelPage/ModelPage.style.js index 20579bd489..cb895b1e20 100644 --- a/src/screens/ModelPage/ModelPage.style.js +++ b/src/screens/ModelPage/ModelPage.style.js @@ -1,7 +1,6 @@ import styled from 'styled-components'; -export const Wrapper = styled.div` -`; +export const Wrapper = styled.div``; export const Content = styled.div` text-align: center; @@ -14,12 +13,12 @@ export const Content = styled.div` `; export const ShareSpacer = styled.div` - padding-right: 32px; + padding-right: 32px; `; export const ShareContainer = styled.div` - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; `; diff --git a/src/serviceWorker.js b/src/serviceWorker.js index c4838eb55f..d9447f54d7 100644 --- a/src/serviceWorker.js +++ b/src/serviceWorker.js @@ -16,8 +16,8 @@ const isLocalhost = Boolean( window.location.hostname === '[::1]' || // 127.0.0.0/8 are considered localhost for IPv4. window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/, + ), ); export function register(config) { @@ -43,7 +43,7 @@ export function register(config) { navigator.serviceWorker.ready.then(() => { console.log( 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' + 'worker. To learn more, visit https://bit.ly/CRA-PWA', ); }); } else { @@ -71,7 +71,7 @@ function registerValidSW(swUrl, config) { // content until all client tabs are closed. console.log( 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.', ); // Execute callback @@ -101,7 +101,7 @@ function registerValidSW(swUrl, config) { function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl, { - headers: { 'Service-Worker': 'script' } + headers: { 'Service-Worker': 'script' }, }) .then(response => { // Ensure service worker exists, and that we really are getting a JS file. @@ -123,7 +123,7 @@ function checkValidServiceWorker(swUrl, config) { }) .catch(() => { console.log( - 'No internet connection found. App is running in offline mode.' + 'No internet connection found. App is running in offline mode.', ); }); } diff --git a/src/utils/model.js b/src/utils/model.js index 7dde127ee8..56c06d6f01 100644 --- a/src/utils/model.js +++ b/src/utils/model.js @@ -1,9 +1,9 @@ -import { useState, useEffect } from "react"; +import { useState, useEffect } from 'react'; async function fetchAll(urls) { try { var data = await Promise.all( - urls.map(url => fetch(url).then(response => response.json())) + urls.map(url => fetch(url).then(response => response.json())), ); return data; @@ -17,10 +17,12 @@ async function fetchAll(urls) { export function useModelDatas(location) { const [modelDatas, setModelDatas] = useState(null); - useEffect(() => { async function fetchData() { - let urls = Array.from({ length: 8 }, (x, i) => `/data/${location}.${i}.json`); + let urls = Array.from( + { length: 8 }, + (x, i) => `/data/${location}.${i}.json`, + ); let loadedModelDatas = await fetchAll(urls); setModelDatas(loadedModelDatas); } @@ -35,7 +37,7 @@ const COLUMNS = { cumulativeDeaths: 10, cumulativeInfected: 9, totalPopulation: 16, - date: 0 + date: 0, }; const DAYS = 1000 * 60 * 60 * 24; @@ -89,7 +91,6 @@ export class Model { this.dateOverwhelmed = new Date( this.dates[overwhelmedIdx].getTime() - dayDelta * DAYS, ); - } this.totalPopulation = _parseInt(data[0][COLUMNS.totalPopulation]); @@ -131,7 +132,10 @@ export class Model { } get interventionEnd() { - return new Date(this.dayZero.getTime() + (this.daysSinceDayZero + this.durationDays) * DAYS); + return new Date( + this.dayZero.getTime() + + (this.daysSinceDayZero + this.durationDays) * DAYS, + ); } idxForDay = day => Math.ceil(day / 4); From b5252c3471bca76ed6477aeffad620f4f76a79d3 Mon Sep 17 00:00:00 2001 From: Rachel RoseFigura Date: Mon, 23 Mar 2020 21:57:49 -0700 Subject: [PATCH 3/6] Add ESLint and prettier --- .eslintrc.js | 32 ++++++++++++++++++ .prettierignore | 28 +++++++++++++++ .prettierrc | 4 --- .prettierrc.js | 5 +++ package.json | 11 ++++-- yarn.lock | 90 ++++++++++++++++++++++++++++++++++++++++++++----- 6 files changed, 156 insertions(+), 14 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .prettierignore delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..b242c07e60 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,32 @@ +module.exports = { + env: { + browser: true, + es6: true, + }, + parser: 'babel-eslint', + extends: ['prettier', 'prettier/react', 'plugin:prettier/recommended'], + globals: { + Atomics: 'readonly', + SharedArrayBuffer: 'readonly', + }, + parserOptions: { + ecmaFeatures: { + jsx: true, + modules: true, + }, + ecmaVersion: 2018, + sourceType: 'module', + }, + plugins: ['react', 'prettier'], + rules: { + 'prettier/prettier': 'error', + 'react/jsx-filename-extension': [1, { extensions: ['.js'] }], + 'react/forbid-prop-types': [0, { forbid: ['any'] }], + 'react/prop-types': 0, + }, + env: { + jest: true, + browser: true, + node: true, + }, +}; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..b76d7fb251 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,28 @@ +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build +creds.sh +token.json + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# ides +.idea +.tern-port +.vscode/ \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index a20502b7f0..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all" -} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000..8c2cb14966 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + singleQuote: true, + trailingComma: 'all', + arrowParens: 'avoid', +}; diff --git a/package.json b/package.json index f6943b9d8e..7320a73f67 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,11 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "lint": "eslint src || printf '\\n\\e[31mRun lint-fix to fix\\e[0m\\n\\n'", + "lint-fix": "eslint --fix src", + "prettier": "prettier --check '**/*.{css,scss,js}' || printf '\\n\\e[31mRun prettier-fix to fix\\e[0m\\n\\n'", + "prettier-fix": "prettier --write '**/*.{css,scss,js}'" }, "eslintConfig": { "extends": "react-app" @@ -46,6 +50,9 @@ ] }, "devDependencies": { - "prettier": "1.19.1" + "eslint": "6.8.0", + "eslint-config-prettier": "6.10.1", + "eslint-plugin-prettier": "3.1.2", + "prettier": "2.0.2" } } diff --git a/yarn.lock b/yarn.lock index 5e8f10df9c..6b9137d85d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4099,6 +4099,13 @@ escodegen@^1.11.0, escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" +eslint-config-prettier@6.10.1: + version "6.10.1" + resolved "https://unpm.uberinternal.com/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a" + integrity sha1-Ep757FddXdwOJpZnvwne/NiYZCo= + dependencies: + get-stdin "^6.0.0" + eslint-config-react-app@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.0.tgz#135110ba56a9e378f7acfe5f36e2ae76a2317899" @@ -4173,6 +4180,13 @@ eslint-plugin-jsx-a11y@6.2.3: has "^1.0.3" jsx-ast-utils "^2.2.1" +eslint-plugin-prettier@3.1.2: + version "3.1.2" + resolved "https://unpm.uberinternal.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" + integrity sha1-Qy5aZnZmq4TOcvlFxy932Zalybo= + dependencies: + prettier-linter-helpers "^1.0.0" + eslint-plugin-react-hooks@^1.6.1: version "1.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04" @@ -4221,6 +4235,49 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== +eslint@6.8.0: + version "6.8.0" + resolved "https://unpm.uberinternal.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha1-YiYtZylzn5J1cjgkMC+yJ8jJP/s= + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.10.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^7.0.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.14" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.3" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" + table "^5.2.3" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + eslint@^6.6.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" @@ -4491,6 +4548,11 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://unpm.uberinternal.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha1-c+4RmC2Gyq95WYKNUZz+kn+sXwM= + fast-glob@^2.0.2: version "2.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" @@ -4896,6 +4958,11 @@ get-own-enumerable-property-symbols@^3.0.0: resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://unpm.uberinternal.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha1-ngm/cSs2CrkiXoEgSPcf3pyJZXs= + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -7188,10 +7255,10 @@ mkdirp@^1.0.3: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea" integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g== -momentjs@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/momentjs/-/momentjs-2.0.0.tgz#73df904b4fa418f6e3c605e831cef6ed5518ebd4" - integrity sha1-c9+QS0+kGPbjxgXoMc727VUY69Q= +moment@^2.24.0: + version "2.24.0" + resolved "https://unpm.uberinternal.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" + integrity sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s= move-concurrently@^1.0.1: version "1.0.1" @@ -8738,10 +8805,17 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://unpm.uberinternal.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha1-0j1B/hN1ZG3i0BBNNFSjAIgCz3s= + dependencies: + fast-diff "^1.1.2" + +prettier@2.0.2: + version "2.0.2" + resolved "https://unpm.uberinternal.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08" + integrity sha1-G6jz65IjHnabf818tzrhtrdK3gg= pretty-bytes@^5.1.0: version "5.3.0" From fd8315a9cfb7c85e985bb87c7998df1b674a72e8 Mon Sep 17 00:00:00 2001 From: Rachel RoseFigura Date: Mon, 23 Mar 2020 22:00:02 -0700 Subject: [PATCH 4/6] lint --- cypress/integration/homepage.js | 20 ++-- cypress/plugins/index.js | 2 +- cypress/support/index.js | 2 +- get-data.js | 39 ++++--- scripts/resize-images.js | 15 ++- src/App.css | 18 ++- src/App.js | 2 +- src/assets/theme/overrides/index.js | 2 +- src/assets/theme/sizes.js | 2 +- src/assets/theme/typography.js | 16 +-- src/components/AppBar/AppBar.js | 14 +-- src/components/AppBar/AppBar.style.js | 52 ++++----- src/components/AppBar/Burger.js | 10 +- src/components/AppBar/MobileMenu.js | 8 +- src/components/Callout/Callout.js | 18 +-- src/components/Chart/Chart.js | 4 +- .../EndorsementCard/EndorsementCard.js | 14 ++- .../EndorsementCard/EndorsementCard.style.js | 5 +- src/components/Footer/Footer.js | 8 +- src/components/Footer/Footer.style.js | 3 +- src/components/Newsletter/Newsletter.js | 10 +- src/components/Newsletter/Newsletter.style.js | 3 +- src/enums/endorsers.js | 10 +- src/enums/team.js | 109 +++++++++--------- src/index.css | 2 +- src/screens/About/About.js | 109 ++++++++++++++---- src/screens/Contact/Contact.js | 23 ++-- src/screens/Endorsements/Endorsements.js | 7 +- .../Endorsements/Endorsements.style.js | 3 +- src/screens/FAQ/FAQ.js | 5 +- src/screens/HomePage/HomePage.js | 32 +++-- src/screens/ModelPage/ModelPage.style.js | 13 +-- src/serviceWorker.js | 12 +- 33 files changed, 345 insertions(+), 247 deletions(-) diff --git a/cypress/integration/homepage.js b/cypress/integration/homepage.js index 15f4cf262b..f2ecdbb936 100644 --- a/cypress/integration/homepage.js +++ b/cypress/integration/homepage.js @@ -1,14 +1,10 @@ describe('Main App Should be Visible', () => { - beforeEach(() => { - cy.visit('/') - cy.get('#root') - .should('be.visible') - }) + beforeEach(() => { + cy.visit('/'); + cy.get('#root').should('be.visible'); + }); - it(`Can See Map`, () => { - cy.get('.us-state-map') - .should('be.visible') - }) - - -}) + it(`Can See Map`, () => { + cy.get('.us-state-map').should('be.visible'); + }); +}); diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index aa9918d215..8dd144a6c1 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -18,4 +18,4 @@ module.exports = (on, config) => { // `on` is used to hook into various events Cypress emits // `config` is the resolved Cypress config -} +}; diff --git a/cypress/support/index.js b/cypress/support/index.js index d68db96df2..37a498fb5b 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/get-data.js b/get-data.js index 5dc7a91e45..d47aac31f0 100644 --- a/get-data.js +++ b/get-data.js @@ -1,6 +1,6 @@ const fs = require('fs'); const readline = require('readline'); -const { google } = require("googleapis"); +const { google } = require('googleapis'); let MODELS = [ 'MAIN MODEL - Current Trends', @@ -39,9 +39,12 @@ fs.readFile('credentials.json', (err, content) => { * @param {function} callback The callback to call with the authorized client. */ function authorize(credentials, callback) { - const {client_secret, client_id, redirect_uris} = credentials.installed; + const { client_secret, client_id, redirect_uris } = credentials.installed; const oAuth2Client = new google.auth.OAuth2( - client_id, client_secret, redirect_uris[0]); + client_id, + client_secret, + redirect_uris[0], + ); // Check if we have previously stored a token. fs.readFile(TOKEN_PATH, (err, token) => { @@ -67,13 +70,17 @@ function getNewToken(oAuth2Client, callback) { input: process.stdin, output: process.stdout, }); - rl.question('Enter the code from that page here: ', (code) => { + rl.question('Enter the code from that page here: ', code => { rl.close(); oAuth2Client.getToken(code, (err, token) => { - if (err) return console.error('Error while trying to retrieve access token', err); + if (err) + return console.error( + 'Error while trying to retrieve access token', + err, + ); oAuth2Client.setCredentials(token); // Store the token to disk for later program executions - fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => { + fs.writeFile(TOKEN_PATH, JSON.stringify(token), err => { if (err) return console.error(err); console.log('Token stored to', TOKEN_PATH); }); @@ -89,18 +96,22 @@ function getNewToken(oAuth2Client, callback) { */ function downloadModel(auth, location, model) { - const sheets = google.sheets({version: 'v4', auth}); + const sheets = google.sheets({ version: 'v4', auth }); sheets.spreadsheets.values.get( { - spreadsheetId: "1YEj4Vr6lG1jQ1R3LG6frijJYNynKcgTjzo2n0FsBwZA", - range: `${MODELS[model]}!C19:U92` + spreadsheetId: '1YEj4Vr6lG1jQ1R3LG6frijJYNynKcgTjzo2n0FsBwZA', + range: `${MODELS[model]}!C19:U92`, }, (err, res) => { - if (err) return console.log("The API returned an error: " + err); + if (err) return console.log('The API returned an error: ' + err); const rows = res.data.values; - fs.writeFile(`public/data/${location}.${model}.json`, JSON.stringify(rows), err => { - if (err) return console.error(err); - }); - } + fs.writeFile( + `public/data/${location}.${model}.json`, + JSON.stringify(rows), + err => { + if (err) return console.error(err); + }, + ); + }, ); } diff --git a/scripts/resize-images.js b/scripts/resize-images.js index 8526a892ea..3de7301acc 100644 --- a/scripts/resize-images.js +++ b/scripts/resize-images.js @@ -1,18 +1,21 @@ -const fs = require('fs'); -const util = require('util'); -const path = require('path'); +const fs = require('fs'); +const util = require('util'); +const path = require('path'); const sharp = require('sharp'); // Resize images to constant width / height // removing resized images: find public/images/endorsers -regex ".*resized.*" -delete -(async() => { +(async () => { const width = 100; const height = 100; - const imageFolder = 'endorsers' + const imageFolder = 'endorsers'; try { const readdirAsync = util.promisify(fs.readdir); - const directoryPath = path.join(__dirname, `../public/images/${imageFolder}`); + const directoryPath = path.join( + __dirname, + `../public/images/${imageFolder}`, + ); const files = await readdirAsync(directoryPath); diff --git a/src/App.css b/src/App.css index e7c25a1346..15f415d29c 100644 --- a/src/App.css +++ b/src/App.css @@ -1,21 +1,20 @@ .graphs-container { - } -.small-graph -{ - float:left; +.small-graph { + float: left; width: 50%; } .clear { - clear:both; + clear: both; } h4 { margin-top: 50px; } -th, td { +th, +td { padding: 10px; width: 25%; } @@ -24,15 +23,14 @@ tr { } @media only screen and (max-width: 600px) { - .small-graph - { + .small-graph { float: unset; width: 100%; } } .analysis-group { - background-color: "#fafafa"; + background-color: '#fafafa'; padding: 20; margin-top: 20; } @@ -71,6 +69,6 @@ tr { } .Map path:hover { - opacity: 0.50; + opacity: 0.5; cursor: pointer; } diff --git a/src/App.js b/src/App.js index 3af4581538..3d0a05cc51 100644 --- a/src/App.js +++ b/src/App.js @@ -9,7 +9,7 @@ import HomePage from 'screens/HomePage/HomePage'; import FAQ from 'screens/FAQ/FAQ'; import Contact from 'screens/Contact/Contact'; import Endorsements from 'screens/Endorsements/Endorsements'; -import About from 'screens/About/About' +import About from 'screens/About/About'; import AppBar from 'components/AppBar/AppBar'; import Footer from 'components/Footer/Footer'; import theme from 'assets/theme'; diff --git a/src/assets/theme/overrides/index.js b/src/assets/theme/overrides/index.js index c44c0405fe..016840e923 100644 --- a/src/assets/theme/overrides/index.js +++ b/src/assets/theme/overrides/index.js @@ -9,5 +9,5 @@ export default { MuiIconButton, MuiPaper, MuiTableCell, - MuiTableHead + MuiTableHead, }; diff --git a/src/assets/theme/sizes.js b/src/assets/theme/sizes.js index 123663ae45..fe58ac30a9 100644 --- a/src/assets/theme/sizes.js +++ b/src/assets/theme/sizes.js @@ -3,5 +3,5 @@ export const materialSMBreakpoint = '600px'; export default { mobileBreakpoint, - materialSMBreakpoint + materialSMBreakpoint, }; diff --git a/src/assets/theme/typography.js b/src/assets/theme/typography.js index fb5cd9ec83..a8a3362d19 100644 --- a/src/assets/theme/typography.js +++ b/src/assets/theme/typography.js @@ -41,20 +41,20 @@ export default { color: palette.text.primary, fontSize: '16px', letterSpacing: '-0.05px', - lineHeight: '25px' + lineHeight: '25px', }, subtitle2: { color: palette.text.secondary, fontWeight: 400, fontSize: '14px', letterSpacing: '-0.05px', - lineHeight: '21px' + lineHeight: '21px', }, body1: { color: palette.text.primary, fontSize: '0.9rem', letterSpacing: '-0.05px', - lineHeight: '21px' + lineHeight: '21px', }, body2: { color: palette.text.secondary, @@ -63,20 +63,20 @@ export default { fontSize: '1rem', }, letterSpacing: '-0.04px', - lineHeight: '1.4rem' + lineHeight: '1.4rem', }, whiteText: { color: palette.white, }, button: { color: palette.text.primary, - fontSize: '14px' + fontSize: '14px', }, caption: { color: palette.text.secondary, fontSize: '11px', letterSpacing: '0.33px', - lineHeight: '13px' + lineHeight: '13px', }, overline: { color: palette.text.secondary, @@ -84,6 +84,6 @@ export default { fontWeight: 500, letterSpacing: '0.33px', lineHeight: '13px', - textTransform: 'uppercase' - } + textTransform: 'uppercase', + }, }; diff --git a/src/components/AppBar/AppBar.js b/src/components/AppBar/AppBar.js index b9ebb0cfba..5af092d1e1 100644 --- a/src/components/AppBar/AppBar.js +++ b/src/components/AppBar/AppBar.js @@ -1,10 +1,10 @@ -import React, { useState } from 'react'; +import React, { useState } from 'react'; import { useHistory, useLocation, matchPath, Link } from 'react-router-dom'; -import { ArrowBack } from '@material-ui/icons'; -import Typography from '@material-ui/core/Typography'; -import Logo from 'assets/images/logo'; -import MobileMenu from './MobileMenu'; -import Burger from './Burger'; +import { ArrowBack } from '@material-ui/icons'; +import Typography from '@material-ui/core/Typography'; +import Logo from 'assets/images/logo'; +import MobileMenu from './MobileMenu'; +import Burger from './Burger'; import { Wrapper, Left, @@ -51,7 +51,7 @@ const _AppBar = () => { window.scrollTo(0, 0); }; - const shareURL = `https://covidactnow.org${match ? match.url : '' }`; + const shareURL = `https://covidactnow.org${match ? match.url : ''}`; const hashtag = 'COVIDActNow'; const stateShareTitle = `This is the point of no return for intervention to prevent ${locationName}'s hospital system from being overloaded by Coronavirus: `; const defaultShareTitle = diff --git a/src/components/AppBar/AppBar.style.js b/src/components/AppBar/AppBar.style.js index e9e06830e7..2e607e1f4b 100644 --- a/src/components/AppBar/AppBar.style.js +++ b/src/components/AppBar/AppBar.style.js @@ -1,19 +1,18 @@ import styled from 'styled-components'; import AppBar from '@material-ui/core/AppBar'; -import Tabs from '@material-ui/core/Tabs'; -import Tab from '@material-ui/core/Tab'; +import Tabs from '@material-ui/core/Tabs'; +import Tab from '@material-ui/core/Tab'; import palette from 'assets/theme/palette'; import { mobileBreakpoint } from 'assets/theme/sizes'; - -export const Wrapper = styled.div ` +export const Wrapper = styled.div` display: flex; justify-content: space-between; height: 64px; padding: 0 20px; - @media(min-width: ${mobileBreakpoint}) { + @media (min-width: ${mobileBreakpoint}) { padding: 0 20px; } `; @@ -23,7 +22,7 @@ export const StyledAppBar = styled(AppBar)` border-bottom: 1px solid #e3e3e3; `; -export const Left = styled.div ` +export const Left = styled.div` display: flex; justify-content: space-between; align-items: center; @@ -38,21 +37,17 @@ export const Left = styled.div ` } `; -export const StyledDesktopMenu = styled(Tabs) -` +export const StyledDesktopMenu = styled(Tabs)` display: none; - @media(min-width: ${mobileBreakpoint}) { - display: inline-block; + @media (min-width: ${mobileBreakpoint}) { + display: inline-block; } `; -export const StyledTabs = styled(Tabs) -` -`; +export const StyledTabs = styled(Tabs)``; -export const StyledTab = styled(Tab) -` +export const StyledTab = styled(Tab)` min-width: 36px; height: 64px; margin-left: 15px; @@ -74,12 +69,11 @@ export const StyledTab = styled(Tab) } `; - -export const MenuTitle = styled.div ` +export const MenuTitle = styled.div` display: inline-block; `; -export const StyledBurger = styled.button ` +export const StyledBurger = styled.button` position: relative; top: 15px; margin-left: 20px; @@ -101,39 +95,39 @@ export const StyledBurger = styled.button ` div { width: 2rem; height: 0.25rem; - background: ${({ open }) => open ? '#0D0C1D' : '#000000'}; + background: ${({ open }) => (open ? '#0D0C1D' : '#000000')}; border-radius: 10px; position: relative; transform-origin: 1px; :first-child { - transform: ${({ open }) => open ? 'rotate(45deg)' : 'rotate(0)'}; + transform: ${({ open }) => (open ? 'rotate(45deg)' : 'rotate(0)')}; } :nth-child(2) { - opacity: ${({ open }) => open ? '0' : '1'}; - transform: ${({ open }) => open ? 'translateX(20px)' : 'translateX(0)'}; + opacity: ${({ open }) => (open ? '0' : '1')}; + transform: ${({ open }) => (open ? 'translateX(20px)' : 'translateX(0)')}; } :nth-child(3) { - transform: ${({ open }) => open ? 'rotate(-45deg)' : 'rotate(0)'}; + transform: ${({ open }) => (open ? 'rotate(-45deg)' : 'rotate(0)')}; } } `; -export const StyledMobileMenu = styled.nav ` +export const StyledMobileMenu = styled.nav` display: inherit; - @media(min-width: ${mobileBreakpoint}) { + @media (min-width: ${mobileBreakpoint}) { display: none; } `; -export const StyledMenu = styled.nav ` +export const StyledMenu = styled.nav` display: flex; flex-direction: column; background: white; border-top: 1px solid #e3e3e3; - transform: ${({ open }) => open ? 'translateY(64px)' : 'translateY(-100%)'}; + transform: ${({ open }) => (open ? 'translateY(64px)' : 'translateY(-100%)')}; height: 100vh; text-align: left; padding: 1rem 2rem 0; @@ -146,9 +140,9 @@ export const StyledMenu = styled.nav ` cursor: pointer; font-size: 2rem; padding: 1.5rem 0; - color: #0D0C1D; + color: #0d0c1d; text-decoration: none; } `; -export const Content = styled.div ``; +export const Content = styled.div``; diff --git a/src/components/AppBar/Burger.js b/src/components/AppBar/Burger.js index 9d9f81758c..72e60aa25d 100644 --- a/src/components/AppBar/Burger.js +++ b/src/components/AppBar/Burger.js @@ -1,16 +1,14 @@ import React from 'react'; -import { - StyledBurger, -} from './AppBar.style'; +import { StyledBurger } from './AppBar.style'; -const Burger = ({ open, setOpen}) => { +const Burger = ({ open, setOpen }) => { return ( setOpen(!open)}>
      - ) -} + ); +}; export default Burger; diff --git a/src/components/AppBar/MobileMenu.js b/src/components/AppBar/MobileMenu.js index ece790cacc..fb2669c65e 100644 --- a/src/components/AppBar/MobileMenu.js +++ b/src/components/AppBar/MobileMenu.js @@ -1,7 +1,5 @@ import React from 'react'; -import { - StyledMenu, -} from './AppBar.style'; +import { StyledMenu } from './AppBar.style'; const MobileMenu = ({ open, goTo }) => { return ( @@ -22,7 +20,7 @@ const MobileMenu = ({ open, goTo }) => { Contact - ) -} + ); +}; export default MobileMenu; diff --git a/src/components/Callout/Callout.js b/src/components/Callout/Callout.js index 70dfa14aec..642eadf322 100644 --- a/src/components/Callout/Callout.js +++ b/src/components/Callout/Callout.js @@ -1,7 +1,5 @@ import React from 'react'; -import { - StyledCallout, -} from './Callout.style'; +import { StyledCallout } from './Callout.style'; const Callout = ({ children, @@ -9,13 +7,15 @@ const Callout = ({ borderColor = '#e3e3e3', }) => { return ( - + {children} - ) -} + ); +}; export default Callout; diff --git a/src/components/Chart/Chart.js b/src/components/Chart/Chart.js index afd3026950..cc2633e992 100644 --- a/src/components/Chart/Chart.js +++ b/src/components/Chart/Chart.js @@ -54,7 +54,7 @@ const Chart = ({ state, subtitle, data, dateOverwhelmed }) => { }, }, tooltip: { - formatter: function() { + formatter: function () { const date = moment(this.x).format('MMMM D'); const beds = this.y.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); if (this.series.userOptions.type === 'line') { @@ -68,7 +68,7 @@ const Chart = ({ state, subtitle, data, dateOverwhelmed }) => { step: 7, labels: { rotation: -45, - formatter: function() { + formatter: function () { return dateFormat('%b %e', this.value); }, }, diff --git a/src/components/EndorsementCard/EndorsementCard.js b/src/components/EndorsementCard/EndorsementCard.js index ed3c5c406b..602b7fc162 100644 --- a/src/components/EndorsementCard/EndorsementCard.js +++ b/src/components/EndorsementCard/EndorsementCard.js @@ -28,14 +28,24 @@ const EndorsementCard = ({ window.open(profileUrl, '_blank')} - avatar={} + avatar={ + + } title={name} /> {credentials.map((c, index) => ( - + {c} ))} diff --git a/src/components/EndorsementCard/EndorsementCard.style.js b/src/components/EndorsementCard/EndorsementCard.style.js index d5f214755e..b083d38ccf 100644 --- a/src/components/EndorsementCard/EndorsementCard.style.js +++ b/src/components/EndorsementCard/EndorsementCard.style.js @@ -31,8 +31,7 @@ export const Credential = styled(Typography)` font-size: 0.9rem; `; -export const Left = styled.div` -`; +export const Left = styled.div``; export const Quote = styled.div` background-color: white; @@ -43,7 +42,7 @@ export const Quote = styled.div` padding: 24px; p { - font-size: 13px + font-size: 13px; } @media (min-width: 600px) { diff --git a/src/components/Footer/Footer.js b/src/components/Footer/Footer.js index 4196e71f11..e3a85ce7c2 100644 --- a/src/components/Footer/Footer.js +++ b/src/components/Footer/Footer.js @@ -1,5 +1,5 @@ import React from 'react'; -import Logo from 'assets/images/logo'; +import Logo from 'assets/images/logo'; import { useHistory } from 'react-router-dom'; @@ -39,7 +39,11 @@ const Footer = ({ children }) => {
      - Press contact: press@covidactnow.org
      Contribute to this tool + Press contact:{' '} + press@covidactnow.org +
      + Contribute to this + tool
      diff --git a/src/components/Footer/Footer.style.js b/src/components/Footer/Footer.style.js index c9ca329781..e8563a3c55 100644 --- a/src/components/Footer/Footer.style.js +++ b/src/components/Footer/Footer.style.js @@ -31,7 +31,6 @@ export const StyledFooterBodyLinks = styled.div` margin: 0 0 1.5rem; } - @media (min-width: 600px) { flex: 0 0 40%; padding: 3rem 0; @@ -70,7 +69,7 @@ export const StyledFooterHeader = styled.div` height: 65px; } - @media(min-width: 600px) { + @media (min-width: 600px) { padding: 0 4rem; } diff --git a/src/components/Newsletter/Newsletter.js b/src/components/Newsletter/Newsletter.js index 0953731ad0..64e2181ce3 100644 --- a/src/components/Newsletter/Newsletter.js +++ b/src/components/Newsletter/Newsletter.js @@ -4,7 +4,15 @@ import { StyledNewsletter } from './Newsletter.style'; const Newsletter = () => { return ( - + ); }; diff --git a/src/components/Newsletter/Newsletter.style.js b/src/components/Newsletter/Newsletter.style.js index 1ba297c723..a5278e46ac 100644 --- a/src/components/Newsletter/Newsletter.style.js +++ b/src/components/Newsletter/Newsletter.style.js @@ -4,9 +4,8 @@ export const StyledNewsletter = styled.div` iframe { min-height: 350px; - @media(min-width: 600px) { + @media (min-width: 600px) { min-height: 270px; } } `; - diff --git a/src/enums/endorsers.js b/src/enums/endorsers.js index 9c910be849..d9efafbc3f 100644 --- a/src/enums/endorsers.js +++ b/src/enums/endorsers.js @@ -11,12 +11,12 @@ export default [ }, { size: 4, - name: 'Valerie Nurr\'araaluk Davidson', + name: "Valerie Nurr'araaluk Davidson", avatarUrl: '/images/endorsers/Valerie-Davidson-A__resized-100-100.jpg', profileUrl: 'https://en.wikipedia.org/wiki/Valerie_Davidson', credentials: [ 'Former Commissioner of the Alaska Department of Health and Social Services', - 'Founder\'s Council member, United States of Care', + "Founder's Council member, United States of Care", ], }, { @@ -39,16 +39,14 @@ export default [ 'Professor of Health Services, Policy and Practice, Brown University', ], quote: - 'This model offers a great tool for state policy staff who\'s job it is to advise the Governor and the Director of Health regarding what kinds of policies should be instituted to encourage social distancing to minimize contagion with corona virus. Staff need to be prepared to defend with comparative data their recommendations regarding whether to close schools, close bars, restrict gatherings to a select number or encourage non-essential workers to telecommute. This web site offers state specific estimates that demonstrate the impact of such policies on the curve of infections, hospitalizations and deaths in a very sophisticated manner.', + "This model offers a great tool for state policy staff who's job it is to advise the Governor and the Director of Health regarding what kinds of policies should be instituted to encourage social distancing to minimize contagion with corona virus. Staff need to be prepared to defend with comparative data their recommendations regarding whether to close schools, close bars, restrict gatherings to a select number or encourage non-essential workers to telecommute. This web site offers state specific estimates that demonstrate the impact of such policies on the curve of infections, hospitalizations and deaths in a very sophisticated manner.", }, { size: 4, name: 'Ben Goldman-Israelow, MD, PhD', avatarUrl: '/images/endorsers/ben_goldman_israelow__resized-100-100.jpeg', profileUrl: 'https://medicine.yale.edu/profile/benjamin_goldman-israelow/', - credentials: [ - 'Infectious Disease Fellow, Yale School of Medicine', - ], + credentials: ['Infectious Disease Fellow, Yale School of Medicine'], }, { size: 4, diff --git a/src/enums/team.js b/src/enums/team.js index ef2ae04ec7..ae4cdf41bb 100644 --- a/src/enums/team.js +++ b/src/enums/team.js @@ -1,92 +1,93 @@ export default [ { - name: "Max Henderson", - title: "ex-Firebase/Google Executive", - link: "https://www.linkedin.com/in/maxhenderson/", + name: 'Max Henderson', + title: 'ex-Firebase/Google Executive', + link: 'https://www.linkedin.com/in/maxhenderson/', }, { - name: "Representative Jonathan Kreiss-Tomkins", - title: "Alaska Legislature", - link: "https://en.wikipedia.org/wiki/Jonathan_Kreiss-Tomkins", + name: 'Representative Jonathan Kreiss-Tomkins', + title: 'Alaska Legislature', + link: 'https://en.wikipedia.org/wiki/Jonathan_Kreiss-Tomkins', }, { - name: "Igor Kofman", - title: "ex-CTO, Dropbox Paper", - link: "https://twitter.com/igorkofman", + name: 'Igor Kofman', + title: 'ex-CTO, Dropbox Paper', + link: 'https://twitter.com/igorkofman', }, { - name: "Nirav R. Shah", - title: "MD, MPH, senior scholar, Stanford University Clinical Excellence Research Center", - link: "https://profiles.stanford.edu/nirav-shah", + name: 'Nirav R. Shah', + title: + 'MD, MPH, senior scholar, Stanford University Clinical Excellence Research Center', + link: 'https://profiles.stanford.edu/nirav-shah', }, { - name: "Zack Rosen", - title: "CEO, Pantheon", - link: "https://www.linkedin.com/in/zacharyrosen/", + name: 'Zack Rosen', + title: 'CEO, Pantheon', + link: 'https://www.linkedin.com/in/zacharyrosen/', }, { - name: "James Tamplin", - title: "Founder/CEO, Firebase", - link: "https://www.linkedin.com/in/jamest/", + name: 'James Tamplin', + title: 'Founder/CEO, Firebase', + link: 'https://www.linkedin.com/in/jamest/', }, { - name: "Stephen Fiskell", - title: "Founder, Commonbook.me", - link: "https://www.linkedin.com/in/takemoreaction/", + name: 'Stephen Fiskell', + title: 'Founder, Commonbook.me', + link: 'https://www.linkedin.com/in/takemoreaction/', }, { - name: "Zack Rosen", - title: "Engineering Lead, Stitch Labs", - link: "https://www.linkedin.com/in/zack-rosen-a03abb3a/", + name: 'Zack Rosen', + title: 'Engineering Lead, Stitch Labs', + link: 'https://www.linkedin.com/in/zack-rosen-a03abb3a/', }, { - name: "David Strauss", - title: "CTO, Pantheon", - link: "https://twitter.com/davidstrauss?lang=en", + name: 'David Strauss', + title: 'CTO, Pantheon', + link: 'https://twitter.com/davidstrauss?lang=en', }, { - name: "Ali Berlin Johnson", - title: "Ex Lead Designer, Firebase", - link: "https://www.linkedin.com/in/berlinjohnson/", + name: 'Ali Berlin Johnson', + title: 'Ex Lead Designer, Firebase', + link: 'https://www.linkedin.com/in/berlinjohnson/', }, { - name: "Misha Chellam", - title: "Council on Society & Technology", - link: "https://www.linkedin.com/in/mishachellam/", + name: 'Misha Chellam', + title: 'Council on Society & Technology', + link: 'https://www.linkedin.com/in/mishachellam/', }, { - name: "Jacob Redding", - title: "Sr Principal, Accenture", - link: "https://www.linkedin.com/in/jacobredding/", + name: 'Jacob Redding', + title: 'Sr Principal, Accenture', + link: 'https://www.linkedin.com/in/jacobredding/', }, { - name: "Joseph Ensminger", - title: "Founder, J.E. Consulting", - link: "https://www.linkedin.com/in/josephensminger/", + name: 'Joseph Ensminger', + title: 'Founder, J.E. Consulting', + link: 'https://www.linkedin.com/in/josephensminger/', }, { - name: "Simon Frid", - title: "Founder, Fridiculous Ventures", - link: "https://www.linkedin.com/in/simonfrid/", + name: 'Simon Frid', + title: 'Founder, Fridiculous Ventures', + link: 'https://www.linkedin.com/in/simonfrid/', }, { - name: "Virsaviya Efraim", - title: "Software Engineer, Almanac", - link: "https://www.linkedin.com/in/virsaviyaefraim/", + name: 'Virsaviya Efraim', + title: 'Software Engineer, Almanac', + link: 'https://www.linkedin.com/in/virsaviyaefraim/', }, { - name: "Andrew Krackov", - title: "President, Hillcrest Advisory", - link: "https://www.linkedin.com/in/andykrackov/", + name: 'Andrew Krackov', + title: 'President, Hillcrest Advisory', + link: 'https://www.linkedin.com/in/andykrackov/', }, { - name: "Adnan Pirzada", - title: "Software Engineer, Lattice", - link: "https://www.linkedin.com/in/adpirz/", + name: 'Adnan Pirzada', + title: 'Software Engineer, Lattice', + link: 'https://www.linkedin.com/in/adpirz/', }, { - name: "Rachel RoseFigura", - title: "Software Engineer, Uber", - link: "https://www.linkedin.com/in/rachelrosefigura/", + name: 'Rachel RoseFigura', + title: 'Software Engineer, Uber', + link: 'https://www.linkedin.com/in/rachelrosefigura/', }, ]; diff --git a/src/index.css b/src/index.css index 18c3176e8d..e1da81b889 100644 --- a/src/index.css +++ b/src/index.css @@ -9,7 +9,7 @@ body { } html { - overflow-x: hidden; + overflow-x: hidden; } code { diff --git a/src/screens/About/About.js b/src/screens/About/About.js index a6307c91c3..ea5504221a 100644 --- a/src/screens/About/About.js +++ b/src/screens/About/About.js @@ -13,10 +13,18 @@ const About = ({ children }) => { About - CovidActNow.org was created by a team of data scientists, engineers, and designers in partnership with epidemiologists, public health officials, and political leaders to help understand how the COVID-19 pandemic will affect their region. + + CovidActNow.org + {' '} + was created by a team of data scientists, engineers, and designers in + partnership with epidemiologists, public health officials, and + political leaders to help understand how the COVID-19 pandemic will + affect their region. - This tool is built to enable political leaders to quickly make decisions in their Coronavirus response informed by best available data and modeling. + This tool is built to enable political leaders to quickly make + decisions in their Coronavirus response informed by best available + data and modeling. We built this tool to answer critically important questions such as: @@ -26,40 +34,79 @@ const About = ({ children }) => {
    7. What will the impact be in my region be and when can I expect it?
    8. +
    9. How long until my hospital system is under severe pressure?
    10. - How long until my hospital system is under severe pressure? -
    11. -
    12. - What is my menu of interventions, and how will they address the spread of Coronavirus? + What is my menu of interventions, and how will they address the + spread of Coronavirus?
    13. - + Who built this tool? - CoVidActNow was founded by Max Henderson, Rep Jonathan Kreiss-Tomkins, Igor Kofman, and Zack Rosen, with medical and policy guidance from Nirav R. Shah (MD, MPH, senior scholar, Stanford University Clinical Excellence Research Center). + CoVidActNow was founded by{' '} + Max Henderson,{' '} + + Rep Jonathan Kreiss-Tomkins + + , Igor Kofman, and{' '} + Zack Rosen, + with medical and policy guidance from{' '} + Nirav R. Shah{' '} + (MD, MPH, senior scholar, Stanford University Clinical Excellence + Research Center). We have since grown into a large distributed team: -
        - {TEAM.map(teammate => { return
      • - {teammate.name} {" "}{teammate.title} -
      • }) - } -
      +
      - Our work has been validated and endorsed by a number of experts in epidemiology, public health, and medicine. + Our work has been{' '} + + validated and endorsed + {' '} + by a number of experts in epidemiology, public health, and medicine. - Our model is public. + + Our model is public. + - So are our assumptions and definitions. + + So are our assumptions and definitions. + @@ -67,18 +114,30 @@ const About = ({ children }) => { - We built covidactnow.org to solve an urgent problem: If we try to fight COVID in the present we will lose (e.g., Italy). We can only beat COVID by understanding what it will do to us in the near future. + We built covidactnow.org to{' '} + + solve an urgent problem: + {' '} + If we try to fight COVID in the present we will lose (e.g., Italy). We + can only beat COVID by understanding what it will do to us in the near + future. - Coronavirus response leaders need the tools to do this — we are building them the tools. + Coronavirus response leaders need the tools to do this — we are + building them the tools. Can I contribute? - Yes. To improve the capability and accuracy of the tool, we need the help of: + Yes. To improve the capability and accuracy of the tool, we need the + help of:
        @@ -109,7 +168,15 @@ const About = ({ children }) => {
      - Email us to share feedback or access to expertise, questions, or if you otherwise want to help. + + Email us + {' '} + to share feedback or access to expertise, questions, or if you + otherwise want to help. diff --git a/src/screens/Contact/Contact.js b/src/screens/Contact/Contact.js index c9660b8424..eb39b56943 100644 --- a/src/screens/Contact/Contact.js +++ b/src/screens/Contact/Contact.js @@ -1,11 +1,7 @@ import React from 'react'; import Typography from '@material-ui/core/Typography'; -import { - Wrapper, - Content, - StyledContactLink, -} from './Contact.style'; +import { Wrapper, Content, StyledContactLink } from './Contact.style'; const Contact = ({ children }) => { return ( @@ -20,16 +16,16 @@ const Contact = ({ children }) => { Medical Organizations: - + Government Agencies: - + @@ -38,7 +34,10 @@ const Contact = ({ children }) => { press@covidactnow.org
    - Our presskit is available here + Our presskit is available{' '} + + here +
    diff --git a/src/screens/Endorsements/Endorsements.js b/src/screens/Endorsements/Endorsements.js index 5ffb70378e..4eec8d93d7 100644 --- a/src/screens/Endorsements/Endorsements.js +++ b/src/screens/Endorsements/Endorsements.js @@ -24,7 +24,12 @@ const Endorsements = () => { must make now.
    - + {ENDORSERS.map((e, index) => ( diff --git a/src/screens/Endorsements/Endorsements.style.js b/src/screens/Endorsements/Endorsements.style.js index ebb779cf23..1dd03b74a1 100644 --- a/src/screens/Endorsements/Endorsements.style.js +++ b/src/screens/Endorsements/Endorsements.style.js @@ -53,5 +53,4 @@ export const Quote = styled.div` } `; -export const EndorsersWrapper = styled(Grid)` -`; +export const EndorsersWrapper = styled(Grid)``; diff --git a/src/screens/FAQ/FAQ.js b/src/screens/FAQ/FAQ.js index 0c73960893..836e62022b 100644 --- a/src/screens/FAQ/FAQ.js +++ b/src/screens/FAQ/FAQ.js @@ -12,7 +12,10 @@ const FAQ = ({ children }) => { - The model is public, and can be viewed here. Reference materials, including assumptions, logic, and definitions are available here. + The model is public, and{' '} + can be viewed here. Reference + materials, including assumptions, logic, and definitions{' '} + are available here. What are the current limitations of the model? diff --git a/src/screens/HomePage/HomePage.js b/src/screens/HomePage/HomePage.js index 8fb11d98f6..598784dc88 100644 --- a/src/screens/HomePage/HomePage.js +++ b/src/screens/HomePage/HomePage.js @@ -1,15 +1,12 @@ import React from 'react'; -import Typography from '@material-ui/core/Typography'; +import Typography from '@material-ui/core/Typography'; import Header from 'components/Header/Header'; import Map from 'components/Map/Map'; import Endorsements from 'screens/Endorsements/Endorsements'; -import Newsletter from "components/Newsletter/Newsletter" +import Newsletter from 'components/Newsletter/Newsletter'; -import { - Wrapper, - Content, -} from './HomePage.style'; +import { Wrapper, Content } from './HomePage.style'; export default function HomePage() { return ( @@ -19,7 +16,13 @@ export default function HomePage() {

    Click the map to see projections for your state.

    -
    +
    @@ -29,7 +32,11 @@ export default function HomePage() { How to use this tool - + This tool is built to enable political leaders to quickly make decisions in their Coronavirus response informed by best available data and modeling. @@ -38,9 +45,12 @@ export default function HomePage() { Here are the questions we built this tool to answer:
    1. - What will the impact be in my region be and when can I expect it? + What will the impact be in my region be and when can I expect + it? +
    2. +
    3. + How long until my hospital system is under severe pressure?
    4. -
    5. How long until my hospital system is under severe pressure?
    6. What are my menu of interventions, and how will they address the spread of Coronavirus? @@ -51,7 +61,7 @@ export default function HomePage() { Endorsements -
      +
      diff --git a/src/screens/ModelPage/ModelPage.style.js b/src/screens/ModelPage/ModelPage.style.js index 20579bd489..cb895b1e20 100644 --- a/src/screens/ModelPage/ModelPage.style.js +++ b/src/screens/ModelPage/ModelPage.style.js @@ -1,7 +1,6 @@ import styled from 'styled-components'; -export const Wrapper = styled.div` -`; +export const Wrapper = styled.div``; export const Content = styled.div` text-align: center; @@ -14,12 +13,12 @@ export const Content = styled.div` `; export const ShareSpacer = styled.div` - padding-right: 32px; + padding-right: 32px; `; export const ShareContainer = styled.div` - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; `; diff --git a/src/serviceWorker.js b/src/serviceWorker.js index c4838eb55f..d9447f54d7 100644 --- a/src/serviceWorker.js +++ b/src/serviceWorker.js @@ -16,8 +16,8 @@ const isLocalhost = Boolean( window.location.hostname === '[::1]' || // 127.0.0.0/8 are considered localhost for IPv4. window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/, + ), ); export function register(config) { @@ -43,7 +43,7 @@ export function register(config) { navigator.serviceWorker.ready.then(() => { console.log( 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' + 'worker. To learn more, visit https://bit.ly/CRA-PWA', ); }); } else { @@ -71,7 +71,7 @@ function registerValidSW(swUrl, config) { // content until all client tabs are closed. console.log( 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.', ); // Execute callback @@ -101,7 +101,7 @@ function registerValidSW(swUrl, config) { function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl, { - headers: { 'Service-Worker': 'script' } + headers: { 'Service-Worker': 'script' }, }) .then(response => { // Ensure service worker exists, and that we really are getting a JS file. @@ -123,7 +123,7 @@ function checkValidServiceWorker(swUrl, config) { }) .catch(() => { console.log( - 'No internet connection found. App is running in offline mode.' + 'No internet connection found. App is running in offline mode.', ); }); } From a3794d0ef3c6371042a2746b56650f24052aa8b2 Mon Sep 17 00:00:00 2001 From: Rachel RoseFigura Date: Mon, 23 Mar 2020 22:19:01 -0700 Subject: [PATCH 5/6] Fix lint config --- .eslintrc.js | 2 +- package.json | 3 -- src/components/Newsletter/Newsletter.js | 1 + src/components/Status/Status.js | 2 +- src/components/Tabs/Tabs.js | 37 ---------------------- src/components/Tabs/Tabs.style.js | 0 src/screens/ComingSoon/ComingSoon.style.js | 2 -- 7 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 src/components/Tabs/Tabs.js delete mode 100644 src/components/Tabs/Tabs.style.js diff --git a/.eslintrc.js b/.eslintrc.js index b242c07e60..110e7aa7bd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,7 +4,7 @@ module.exports = { es6: true, }, parser: 'babel-eslint', - extends: ['prettier', 'prettier/react', 'plugin:prettier/recommended'], + extends: ['react-app','prettier', 'prettier/react', 'plugin:prettier/recommended'], globals: { Atomics: 'readonly', SharedArrayBuffer: 'readonly', diff --git a/package.json b/package.json index 7320a73f67..6ff96ffe69 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,6 @@ "prettier": "prettier --check '**/*.{css,scss,js}' || printf '\\n\\e[31mRun prettier-fix to fix\\e[0m\\n\\n'", "prettier-fix": "prettier --write '**/*.{css,scss,js}'" }, - "eslintConfig": { - "extends": "react-app" - }, "browserslist": { "production": [ ">0.2%", diff --git a/src/components/Newsletter/Newsletter.js b/src/components/Newsletter/Newsletter.js index 64e2181ce3..0c0d17844a 100644 --- a/src/components/Newsletter/Newsletter.js +++ b/src/components/Newsletter/Newsletter.js @@ -5,6 +5,7 @@ const Newsletter = () => { return (