Skip to content

Commit abc59de

Browse files
Refactor covid apps
1 parent 719e663 commit abc59de

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

src/components/CovidApp.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1+
import React, { Component } from "react";
2+
import axios from "axios";
3+
import Lottie from "react-lottie";
4+
import { formatDistance } from "date-fns";
5+
import { withStyles } from "@material-ui/styles";
6+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
17
import {
28
faBell,
39
faBellSlash,
4-
faSyncAlt
10+
faSyncAlt,
511
} from "@fortawesome/free-solid-svg-icons";
6-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
7-
import { withStyles } from "@material-ui/styles";
8-
import axios from "axios";
9-
import { formatDistance } from "date-fns";
10-
import React, { Component } from "react";
11-
import Lottie from "react-lottie";
12-
import * as animationData from "../assets/loading.json";
13-
import colors from "../constants/colors";
14-
import stateCodes from "../constants/stateCodes";
15-
import styles from "../styles/CovidAppStyles";
16-
import "../styles/DarkModeButton.css";
12+
1713
import Barchart from "./Barchart";
1814
import Charts from "./Charts";
1915
import DisplayTable from "./DisplayTable";
2016
import Footer from "./Footer";
2117
import MapSection from "./MapSection";
2218
import Overview from "./Overview";
2319

20+
import colors from "../constants/colors";
21+
import stateCodes from "../constants/stateCodes";
22+
import * as animationData from "../assets/loading.json";
23+
24+
import styles from "../styles/CovidAppStyles";
25+
import "../styles/DarkModeButton.css";
26+
2427
const defaultOptions = {
2528
loop: true,
2629
autoplay: true,
@@ -40,9 +43,9 @@ const months = {
4043
"07": "Jul",
4144
"08": "Aug",
4245
"09": "Sep",
43-
"10": "Oct",
44-
"11": "Nov",
45-
"12": "Dec",
46+
10: "Oct",
47+
11: "Nov",
48+
12: "Dec",
4649
};
4750

4851
class CovidApp extends Component {
@@ -144,7 +147,7 @@ class CovidApp extends Component {
144147
const month = date.slice(3, 5);
145148
const time = date.slice(11);
146149
return `${day} ${months[month]}, ${time.slice(0, 5)} IST`;
147-
} catch (err) { }
150+
} catch (err) {}
148151
}
149152

150153
render() {
@@ -189,7 +192,7 @@ class CovidApp extends Component {
189192
</div>
190193
);
191194
});
192-
} catch (err) { }
195+
} catch (err) {}
193196

194197
return (
195198
<>
@@ -216,13 +219,13 @@ class CovidApp extends Component {
216219
onClick={this.handleNotification}
217220
/>
218221
) : (
219-
<div className={classes.notificationBell}>
220-
<FontAwesomeIcon
221-
icon={faBell}
222-
onClick={this.handleNotification}
223-
/>
224-
</div>
225-
)}
222+
<div className={classes.notificationBell}>
223+
<FontAwesomeIcon
224+
icon={faBell}
225+
onClick={this.handleNotification}
226+
/>
227+
</div>
228+
)}
226229
</div>
227230
{expanded && <div className={classes.update}>{displayUpdates}</div>}
228231
</div>

0 commit comments

Comments
 (0)