forked from livgust/macovidvaccines.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 6.83 KB
/
.eslintcache
1
[{"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\index.js":"1","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\reportWebVitals.js":"2","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\App.js":"3","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\CovidAppointmentTable.js":"4","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\Availability.js":"5","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\SignUpLink.js":"6","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\MoreInformation.js":"7","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\Menu.js":"8"},{"size":500,"mtime":499162500000,"results":"9","hashOfConfig":"10"},{"size":362,"mtime":499162500000,"results":"11","hashOfConfig":"10"},{"size":985,"mtime":1612580365062,"results":"12","hashOfConfig":"10"},{"size":3012,"mtime":1612361104889,"results":"13","hashOfConfig":"10"},{"size":798,"mtime":1612319098582,"results":"14","hashOfConfig":"10"},{"size":415,"mtime":1612320281278,"results":"15","hashOfConfig":"10"},{"size":1652,"mtime":1612367566160,"results":"16","hashOfConfig":"10"},{"size":3864,"mtime":1612580092016,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},"13l3eve",{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"27","usedDeprecatedRules":"20"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\index.js",[],["36","37"],"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\reportWebVitals.js",[],"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\App.js",[],"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\CovidAppointmentTable.js",["38"],"import Loader from \"react-loader\";\r\nimport React, { useState, useEffect } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core\";\r\nimport Card from \"@material-ui/core/Card\";\r\nimport CardHeader from \"@material-ui/core/CardHeader\";\r\nimport CardContent from \"@material-ui/core/CardContent\";\r\nimport FormControlLabel from \"@material-ui/core/FormControlLabel\";\r\nimport Switch from \"@material-ui/core/Switch\";\r\nimport Availability from \"./components/Availability\";\r\nimport SignUpLink from \"./components/SignUpLink\";\r\nimport MoreInformation from \"./components/MoreInformation\";\r\n\r\nexport function transformData(data) {\r\n\treturn data.map((entry, index) => {\r\n\t\treturn {\r\n\t\t\tkey: index,\r\n\t\t\tlocation: entry.name,\r\n\t\t\tstreetAddress: entry.street,\r\n\t\t\tcity: entry.city,\r\n\t\t\tzip: entry.zip,\r\n\t\t\thasAppointments: entry.hasAvailability,\r\n\t\t\tappointmentData: entry.availability || null,\r\n\t\t\tsignUpLink: entry.signUpLink || null,\r\n\t\t\textraData: entry.extraData || null,\r\n\t\t};\r\n\t});\r\n}\r\n\r\nexport function sortAndFilterData(\r\n\tdata,\r\n\t{ sortKey, sortAsc },\r\n\tonlyShowAvailable\r\n) {\r\n\tconst filteredData = onlyShowAvailable\r\n\t\t? data.filter((entry) => entry.hasAppointments)\r\n\t\t: data;\r\n\tconst newData = filteredData.sort((a, b) => {\r\n\t\tconst first = sortAsc ? a[sortKey] : b[sortKey];\r\n\t\tconst second = sortAsc ? b[sortKey] : a[sortKey];\r\n\t\tif (typeof first == \"string\") {\r\n\t\t\treturn first.localeCompare(second);\r\n\t\t} else {\r\n\t\t\treturn first - second;\r\n\t\t}\r\n\t});\r\n\treturn newData;\r\n}\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n\tcardBox: {\r\n\t\t\"padding-top\": theme.spacing(2),\r\n\t\t\"padding-bottom\": theme.spacing(2),\r\n\t},\r\n}));\r\n\r\nexport default function CovidAppointmentTable() {\r\n\tconst classes = useStyles();\r\n\r\n\tconst [data, setData] = useState([]);\r\n\tconst [sortInfo, setSortInfo] = useState({\r\n\t\tsortKey: \"hasAppointments\",\r\n\t\tsortAsc: false,\r\n\t});\r\n\r\n\tconst [onlyShowAvailable, setOnlyShowAvailable] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tfetch(\"https://mzqsa4noec.execute-api.us-east-1.amazonaws.com/prod\").then(\r\n\t\t\tasync (res) => {\r\n\t\t\t\tconst newData = await res.json();\r\n\t\t\t\tsetData(JSON.parse(newData.body).results);\r\n\t\t\t}\r\n\t\t);\r\n\t}, []);\r\n\r\n\tconst formattedData = sortAndFilterData(\r\n\t\ttransformData(data),\r\n\t\tsortInfo,\r\n\t\tonlyShowAvailable\r\n\t);\r\n\r\n\treturn (\r\n\t\t<Loader loaded={!!data && data.length > 0}>\r\n\t\t\t<FormControlLabel\r\n\t\t\t\tcontrol={\r\n\t\t\t\t\t<Switch\r\n\t\t\t\t\t\tchecked={onlyShowAvailable}\r\n\t\t\t\t\t\tonChange={(event) => setOnlyShowAvailable(event.target.checked)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tlabel=\"Only show locations with available appointments\"\r\n\t\t\t/>\r\n\t\t\t{formattedData.map((entry) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<div className={classes.cardBox}>\r\n\t\t\t\t\t\t<Card>\r\n\t\t\t\t\t\t\t<CardHeader\r\n\t\t\t\t\t\t\t\ttitle={<div>{entry.location}</div>}\r\n\t\t\t\t\t\t\t\tsubheader={<div>{entry.city}</div>}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<CardContent>\r\n\t\t\t\t\t\t\t\t<Availability entry={entry} />\r\n\t\t\t\t\t\t\t\t<MoreInformation entry={entry} />\r\n\t\t\t\t\t\t\t\t<SignUpLink entry={entry} />\r\n\t\t\t\t\t\t\t</CardContent>\r\n\t\t\t\t\t\t</Card>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t</Loader>\r\n\t);\r\n}\r\n","C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\Availability.js",[],"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\SignUpLink.js",[],"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\MoreInformation.js",[],"C:\\Users\\oadams\\Development\\ma_covid_vaccine_website\\src\\components\\Menu.js",[],{"ruleId":"39","replacedBy":"40"},{"ruleId":"41","replacedBy":"42"},{"ruleId":"43","severity":1,"message":"44","line":60,"column":19,"nodeType":"45","messageId":"46","endLine":60,"endColumn":30},"no-native-reassign",["47"],"no-negated-in-lhs",["48"],"no-unused-vars","'setSortInfo' is assigned a value but never used.","Identifier","unusedVar","no-global-assign","no-unsafe-negation"]