-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 9.38 KB
/
.eslintcache
1
[{"G:\\React\\Projects\\COVID-19-Tracker\\src\\index.js":"1","G:\\React\\Projects\\COVID-19-Tracker\\src\\reportWebVitals.js":"2","G:\\React\\Projects\\COVID-19-Tracker\\src\\App.js":"3","G:\\React\\Projects\\COVID-19-Tracker\\src\\Map.js":"4","G:\\React\\Projects\\COVID-19-Tracker\\src\\InfoBox.js":"5","G:\\React\\Projects\\COVID-19-Tracker\\src\\LineGraph.js":"6","G:\\React\\Projects\\COVID-19-Tracker\\src\\Table.js":"7"},{"size":580,"mtime":1608210340857,"results":"8","hashOfConfig":"9"},{"size":375,"mtime":1608210340857,"results":"10","hashOfConfig":"9"},{"size":4445,"mtime":1618594181534,"results":"11","hashOfConfig":"9"},{"size":566,"mtime":1608210340855,"results":"12","hashOfConfig":"9"},{"size":1142,"mtime":1618596598264,"results":"13","hashOfConfig":"9"},{"size":2674,"mtime":1608210340855,"results":"14","hashOfConfig":"9"},{"size":759,"mtime":1608210340856,"results":"15","hashOfConfig":"9"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},"q481jv",{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"21","messages":"22","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"23","usedDeprecatedRules":"18"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"32","usedDeprecatedRules":"18"},"G:\\React\\Projects\\COVID-19-Tracker\\src\\index.js",[],["33","34"],"G:\\React\\Projects\\COVID-19-Tracker\\src\\reportWebVitals.js",[],"G:\\React\\Projects\\COVID-19-Tracker\\src\\App.js",["35","36","37","38"],"import {useEffect, useState} from \"react\";\r\nimport {FormControl, InputLabel, Select, MenuItem, Card, CardContent} from \"@material-ui/core\";\r\nimport * as axios from \"axios\";\r\nimport InfoBox from \"./InfoBox\";\r\nimport Table from \"./Table\";\r\nimport Map from \"./Map\";\r\nimport './App.css';\r\nimport LineGraph from \"./LineGraph\";\r\nimport 'leaflet/dist/leaflet.css'\r\n\r\nfunction App() {\r\n const all_counties_api = 'https://disease.sh/v3/covid-19/countries'\r\n const [countries, setCountries] = useState([])\r\n const [tableData, settableData] = useState([])\r\n const [country, setCountry] = useState('worldwide')\r\n const [countryInfo, setCountryInfo] = useState({})\r\n const [mapCountries, setMapCountries] = useState([]);\r\n const [mapCenter, setMapCenter] = useState({\r\n lat: 34.80746,\r\n lng: -40.4796\r\n })\r\n const [mapZoom, setMapZoom] = useState(3)\r\n useEffect(async () => {\r\n const {data} = await axios('https://disease.sh/v3/covid-19/all');\r\n setCountryInfo(data)\r\n }, [])\r\n\r\n useEffect(() => {\r\n const getCountriesData = async () => {\r\n const {data} = await axios(all_counties_api);\r\n const countries = data.map((country) => ({\r\n name: country.country,\r\n value: country.countryInfo.iso2\r\n }))\r\n setCountries(countries)\r\n setMapCountries(data)\r\n settableData(data)\r\n }\r\n getCountriesData()\r\n }, []);\r\n\r\n const onCountryChange = (event) => {\r\n const countryCode = event.target.value\r\n const url = countryCode === 'worldwide' ? 'https://disease.sh/v3/covid-19/all' : `${all_counties_api}/${countryCode}`\r\n const getCountryData = async () => {\r\n const {data} = await axios(url);\r\n setCountry(countryCode)\r\n setCountryInfo(data)\r\n }\r\n getCountryData()\r\n }\r\n\r\n return (\r\n <div className='app row mt-3 mx-5'>\r\n <div className=\"app__left col-md-9\">\r\n <div className=\"app__header d-flex flex-wrap justify-content-between align-self-center\">\r\n <h2>Covid-19 Tracker</h2>\r\n <FormControl variant=\"outlined\">\r\n <Select labelId=\"countries-dropdown-label\" id=\"countries-dropdown\" value={country}\r\n onChange={onCountryChange}>\r\n <MenuItem value='worldwide'>Worldwide</MenuItem>\r\n {\r\n countries.map((country, index) =>\r\n <MenuItem\r\n key={index}\r\n value={country.value}\r\n >\r\n {country.name}\r\n </MenuItem>\r\n )\r\n }\r\n </Select>\r\n </FormControl>\r\n </div>\r\n <div className='app__states row justify-content-between align-self-center'>\r\n <div className=\"flex-grow-1 m-sm-2\">\r\n <InfoBox title='Cases'\r\n cases={countryInfo.todayCases}\r\n total={countryInfo.cases}/>\r\n </div>\r\n <div className=\"flex-grow-1 m-sm-2\">\r\n <InfoBox title='Recovered' cases={countryInfo.todayRecovered}\r\n total={countryInfo.recovered}/>\r\n </div>\r\n <div className=\"flex-grow-1 m-sm-2\">\r\n <InfoBox title='Deaths' cases={countryInfo.todayDeaths}\r\n total={countryInfo.deaths}/>\r\n </div>\r\n </div>\r\n <Map countries={mapCountries} center={mapCenter} zoom={mapZoom}/>\r\n </div>\r\n <div className=\"app_right col-md-3\">\r\n <Card>\r\n <CardContent>\r\n <h5>Live Cases By Country</h5>\r\n <Table tableData={tableData}/>\r\n <h5 className='mt-3'>Worldwide New Cases</h5>\r\n <LineGraph/>\r\n </CardContent>\r\n </Card>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n\r\nexport default App;\r\n","G:\\React\\Projects\\COVID-19-Tracker\\src\\Map.js",[],"G:\\React\\Projects\\COVID-19-Tracker\\src\\InfoBox.js",["39"],"G:\\React\\Projects\\COVID-19-Tracker\\src\\LineGraph.js",[],"G:\\React\\Projects\\COVID-19-Tracker\\src\\Table.js",["40"],"import React from 'react';\r\nimport './App.css'\r\nconst Table = ({tableData}) => {\r\n tableData.sort((a, b) => b.cases -a.cases)\r\n return (\r\n <div className='table-div'>\r\n <table className=\"table table-striped\">\r\n <tbody>\r\n {\r\n tableData.map((country, index) =>\r\n <tr key={index}>\r\n <td><img src={country.countryInfo.flag} height='28' width='40'/></td>\r\n <td>{country.country}</td>\r\n <td className='text-right'>{country.cases}</td>\r\n </tr>)\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Table;\r\n",{"ruleId":"41","replacedBy":"42"},{"ruleId":"43","replacedBy":"44"},{"ruleId":"45","severity":1,"message":"46","line":2,"column":22,"nodeType":"47","messageId":"48","endLine":2,"endColumn":32},{"ruleId":"45","severity":1,"message":"49","line":18,"column":23,"nodeType":"47","messageId":"48","endLine":18,"endColumn":35},{"ruleId":"45","severity":1,"message":"50","line":22,"column":21,"nodeType":"47","messageId":"48","endLine":22,"endColumn":31},{"ruleId":"51","severity":1,"message":"52","line":23,"column":15,"nodeType":"53","endLine":26,"endColumn":6},{"ruleId":"45","severity":1,"message":"54","line":2,"column":28,"nodeType":"47","messageId":"48","endLine":2,"endColumn":38},{"ruleId":"55","severity":1,"message":"56","line":12,"column":33,"nodeType":"57","endLine":12,"endColumn":93},"no-native-reassign",["58"],"no-negated-in-lhs",["59"],"no-unused-vars","'InputLabel' is defined but never used.","Identifier","unusedVar","'setMapCenter' is assigned a value but never used.","'setMapZoom' is assigned a value but never used.","react-hooks/exhaustive-deps","Effect callbacks are synchronous to prevent race conditions. Put the async function inside:\n\nuseEffect(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching","ArrowFunctionExpression","'Typography' is defined but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","no-global-assign","no-unsafe-negation"]