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 from "react" | |
| import styled from "styled-components" | |
| import Loader from "react-loader-spinner" | |
| import "react-loader-spinner/dist/loader/css/react-spinner-loader.css" | |
| const StyledLoadingIndicator = styled("div")` | |
| position: absolute; | |
| top: 1rem; | |
| left: 50%; |
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 from "react" | |
| import { useRecoilValue, useRecoilValueLoadable } from "recoil" | |
| import { format } from "date-fns" | |
| import { mapboxToken } from "../../mapbox-token" | |
| import { currentDateState } from "../../state/app" | |
| import { API_DATE_FORMAT, statusByDateQuery, countriesQuery } from "../../state/api" | |
| import DataMap from "./DataMap" |
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 { selector, atom } from "recoil" | |
| import { isAfter, isBefore } from "date-fns" | |
| export const DATE_RANGE = [new Date("10 Jan 2020"), new Date()] | |
| const dateState = atom({ | |
| key: "date-state", | |
| default: DATE_RANGE[1], | |
| }) |
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 from "react" | |
| import styled from "styled-components" | |
| import { useRecoilState } from "recoil" | |
| import { currentDateState, DATE_RANGE } from "../../state/app" | |
| import { differenceInCalendarDays, addDays } from "date-fns" | |
| const StyledTimeTravelSlider = styled("div")` | |
| display: flex; | |
| flex-flow: column; | |
| align-items: center; |
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 { selector, selectorFamily, waitForNone } from "recoil" | |
| import { format, subDays, differenceInCalendarDays } from "date-fns" | |
| import { currentDateState, DATE_RANGE } from "../app" | |
| export const API_DATE_FORMAT = "yyyy-MM-dd" | |
| export const countriesQuery = selector({ | |
| key: "countries", | |
| get: async () => { | |
| try { |
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 { selector, atom } from "recoil" | |
| import { isAfter, isBefore } from "date-fns" | |
| export const CASES = "cases" | |
| export const DEATHS = "deaths" | |
| export const RECOVERED = "recovered" | |
| export const availableStats = [CASES, DEATHS, RECOVERED] | |
| export const currentStatState = atom({ |