Skip to content

Commit 6cf245c

Browse files
Add table
1 parent 0c00070 commit 6cf245c

File tree

3 files changed

+78
-18
lines changed

3 files changed

+78
-18
lines changed

src/components/CovidApp.js

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,31 @@ const styles = {
4747
borderRadius: "2rem",
4848
marginTop: "3rem",
4949
display: "flex",
50-
justifyContent: "space-between",
51-
alignItems: "center",
5250
padding: "4rem",
51+
flexDirection: "column",
52+
justifyContent: "center",
5353
},
5454
contentArea: {
55-
minWidth: "50%",
55+
display: "flex",
56+
},
57+
mapArea: {
58+
flex: "1",
5659
},
5760
chartArea: {
58-
// flex: "1",
5961
minWidth: "50%",
6062
display: "flex",
61-
flexDirection: "column",
6263
justifyContent: "center",
63-
// alignItems: "center",
64+
},
65+
tableContainer: {
66+
padding: "2rem",
67+
margin: "5rem 0",
68+
},
69+
70+
tableHeading: {
71+
textAlign: "center",
72+
margin: "4rem 0",
73+
fontSize: "3rem",
74+
// textTransform: "uppercase",
6475
},
6576
};
6677

@@ -208,17 +219,33 @@ class CovidApp extends Component {
208219
/>
209220
{!this.state.isLoading && (
210221
<div className={classes.content}>
211-
<div className={classes.contentArea}></div>
222+
<div className={classes.contentArea}>
223+
<div className={classes.mapArea}>
224+
<Map mapData={mapData} />
225+
</div>
226+
<div></div>
227+
</div>
212228
<div className={classes.chartArea}>
213-
<Map mapData={mapData} />
214229
<Charts
215230
data={this.state.completeData}
216231
isLoading={this.state.isLoading}
217232
/>
233+
<Charts
234+
data={this.state.completeData}
235+
isLoading={this.state.isLoading}
236+
/>
237+
</div>
238+
<div className={classes.tableContainer}>
239+
<h2 className={classes.tableHeading}>
240+
State/UT Wise Data (Sortable){" "}
241+
</h2>
242+
<DisplayTable tableData={tableData} />
218243
</div>
219244
</div>
220245
)}
221-
<DisplayTable tableData={tableData} />
246+
{/* {!this.state.isLoading && (
247+
248+
)} */}
222249
</div>
223250
</div>
224251
);

src/components/Overview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const styles = {
1717
},
1818
btnBox: {
1919
position: "absolute",
20-
top: "-1.5%",
20+
top: "-.5%",
2121
left: "27%",
2222
marginLeft: "2rem",
2323
// transform: "translate(-50%, 0)",

src/components/Table/DisplayTable.css

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,69 @@ table {
55

66
thead th {
77
text-align: left;
8-
border-bottom: 2px solid black;
8+
margin-right: 1rem;
9+
margin-left: 1rem;
10+
color: #1A1053;
11+
/* border-bottom: 2px solid black; */
912
}
1013

1114
thead button {
15+
font-family: inherit;
16+
width: 100%;
1217
border: 0;
13-
border-radius: none;
18+
border-radius: 2rem;
1419
font-family: inherit;
1520
font-weight: 700;
1621
font-size: inherit;
17-
padding: 0.5em;
22+
padding: 1rem 2rem;
23+
text-align: left;
1824
margin-bottom: 1px;
25+
color: #1A1053;
26+
27+
/* margin: 1rem; */
28+
transition: all .4s;
29+
}
30+
31+
thead button:hover,
32+
thead button:focus {
33+
outline: none;
34+
border: none;
1935
}
2036

2137
thead button.ascending::after {
22-
content: '👇';
38+
content: '\2193';
2339
display: inline-block;
2440
margin-left: 1em;
2541
}
2642

2743
thead button.descending::after {
28-
content: '☝️';
44+
content: '\2191';
2945
display: inline-block;
3046
margin-left: 1em;
3147
}
3248

3349
tbody td {
34-
padding: 0.5em;
35-
border-bottom: 1px solid #ccc;
50+
padding: 1rem;
51+
color: #817C9B;
52+
/* border-radius: 2rem; */
53+
padding: 1rem 2rem;
54+
margin-top: 5rem;
55+
/* background-color: #ccc; */
56+
/* border-bottom: 1px solid #ccc; */
57+
58+
}
59+
60+
tbody tr {
61+
border-radius: 2rem;
62+
/* transition: background-color .5s; */
3663
}
3764

3865
tbody tr:hover {
39-
background-color: #eee;
66+
background-color: #1A1053;
67+
transition: all .3s;
68+
69+
}
70+
71+
tbody tr:hover td {
72+
color: #fff;
4073
}

0 commit comments

Comments
 (0)