This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useContext } from "react"; | |
| import { CityContext } from "../../contexts/CityContext"; | |
| import { Drawer, Alert } from "antd"; | |
| import { CloseOutlined } from "@ant-design/icons"; | |
| import styled from "styled-components"; | |
| import { MiniSearchBar } from "../common/MiniSearchBar"; | |
| const VizButton = styled.button` | |
| display: flex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useEffect, useState } from "react"; | |
| import useWindowSize from "../../utils/useWindowSize"; | |
| import { Link } from "react-router-dom"; | |
| import styled from "styled-components"; | |
| import NavDrawer from "./NavDrawer"; | |
| const Wrapper = styled.header` | |
| display: flex; | |
| justify-content: flex-end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const filterCities = () => { | |
| let result = []; | |
| let { | |
| output0, | |
| output1, | |
| output2, | |
| output3, | |
| output4, | |
| output5, | |
| output6, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // filter cities based on number of citizens testing positive for COVID-19 in that city's state | |
| const covidFilter = maximum => { | |
| // convert COVID-19 and weather data objects to arrays | |
| const covidArray = Object.entries(covid); | |
| const weatherArray = Object.entries(weather); | |
| // initialize array to store filtered cities | |
| const filteredResults = []; | |
| // // loop through all states in array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {isComparing && ( | |
| <div className="comparison-container"> | |
| <div className="comparison"> | |
| {comparisonList.map((city, index) => ( | |
| <CardComparison | |
| key={index} | |
| city={city[0]} | |
| image={city[1]} | |
| index={index} | |
| removeCity={removeCity} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const calcHousingData = (cityStateName, stateCode) => { | |
| try { | |
| console.log("housing data: " + housing[stateCode][cityStateName]); | |
| return housing[stateCode][cityStateName]; | |
| } catch { | |
| console.log("State and city housing data was not found!"); | |
| } | |
| }; | |
| const calcWeatherData = (cityStateName, stateCode) => { |