-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9873842
commit 8e2900c
Showing
8 changed files
with
285 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file specifies files that are *not* uploaded to Google Cloud Platform | ||
# using gcloud. It follows the same syntax as .gitignore, with the addition of | ||
# "#!include" directives (which insert the entries of the given .gitignore-style | ||
# file at that point). | ||
# | ||
# For more information, run: | ||
# $ gcloud topic gcloudignore | ||
# | ||
.gcloudignore | ||
# If you would like to upload your .git directory, .gitignore file or files | ||
# from your .gitignore file, remove the corresponding line | ||
# below: | ||
.git | ||
.gitignore | ||
|
||
# Node.js dependencies: | ||
node_modules/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/server/node_modules | ||
/server/package-lock.json | ||
/server/package-lock.json | ||
/app.yaml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import React , {Component} from 'react'; | ||
import axios from 'axios'; | ||
import Table from '@material-ui/core/Table'; | ||
import TableBody from '@material-ui/core/TableBody'; | ||
import TableCell from '@material-ui/core/TableCell'; | ||
import TableContainer from '@material-ui/core/TableContainer'; | ||
import TableHead from '@material-ui/core/TableHead'; | ||
import TableRow from '@material-ui/core/TableRow'; | ||
|
||
class map extends Component { | ||
constructor (props) { | ||
super(props); | ||
this.state = { | ||
total: {}, | ||
statewise: [] | ||
}; | ||
} | ||
componentDidMount(){ | ||
axios.get('https://api.covidindiatracker.com/state_data.json') | ||
.then(res=> this.setState({statewise: res.data})); | ||
axios.get('https://api.covidindiatracker.com/total.json') | ||
.then(res=> this.setState({total: res.data})); | ||
} | ||
|
||
render () { | ||
|
||
return ( | ||
<div class="row mx-auto"> | ||
|
||
<div class="col-lg-5 container col-sm-12 col-md-12 mx-auto" style={{overflowX: "auto"}}> | ||
<TableContainer> | ||
<Table style={{fontFamily: "Lato sans-serif"}}> | ||
<colgroup> | ||
<col width="30%" /> | ||
<col width="15%" /> | ||
<col width="15%" /> | ||
<col width="15%" /> | ||
<col width="15%" /> | ||
</colgroup> | ||
<TableHead> | ||
<TableRow style={{ height: "10px"}}> | ||
<TableCell style={{color: "black"}}> <b> State </b></TableCell> | ||
<TableCell style={{color: "red"}} > <b>Confirmed </b> </TableCell> | ||
<TableCell style={{color: "blue"}}> <b> Existing</b> </TableCell> | ||
<TableCell style={{color: "green"}} > <b>Recovered</b> </TableCell> | ||
<TableCell style={{color: "grey"}}> <b> Deaths </b> </TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{this.state.statewise.map((data) => ( | ||
<TableRow key={data.name} style={{ height: "10px"}}> | ||
<TableCell style={{color: "black" , textDecoration: "bold"}}> {data.state} </TableCell> | ||
<TableCell style={{color: "red"}}> {data.confirmed} <br/> <b><i> {data.cChanges>=0 ?<span>+</span>: null}{data.cChanges}</i></b></TableCell> | ||
<TableCell style={{color: "blue"}} > {data.active} <br/> <b><i> {data.aChanges>=0 ?<span>+</span>: null}{data.aChanges}</i></b> </TableCell> | ||
<TableCell style={{color: "green"}}> {data.recovered} <br/> <b><i> {data.rChanges>=0 ?<span>+</span>: null}{data.rChanges}</i></b> </TableCell> | ||
<TableCell style={{color: "grey"}} > {data.deaths} <br/> <b><i> {data.dChanges>=0 ?<span>+</span>: null}{data.dChanges}</i></b> </TableCell> | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
</div> | ||
<div class="col-lg-5 container center mx-auto"> | ||
<h1 style={{marginTop: "50px", fontFamily: "roboto"}} class="text-center"> COVID Tracker</h1> | ||
<h2 style={{ fontFamily: "roboto"}}> India </h2> | ||
<div class="card" style={{margin: "30px 50px" }} > | ||
<h4 style={{ fontFamily: "roboto", marginTop:"20px" }}> Confirmed </h4> | ||
<h3 style={{color: "red" , fontFamily:"roboto"}}> | ||
{this.state.total.confirmed} | ||
</h3> | ||
<h6 style={{color: "red" , marginBottom:"20px" , fontFamily:"roboto"}}> <b>+{this.state.total.cChanges} </b> </h6> | ||
</div> | ||
<div class="card" style={{margin: "30px 50px"}}> | ||
<h4 style={{ fontFamily: "roboto", marginTop:"20px" }}> Active </h4> | ||
<h3 style={{color: "blue" , fontFamily:"roboto"}}> | ||
{this.state.total.active} | ||
</h3> | ||
<h6 style={{color: "blue" , marginBottom:"20px" , fontFamily:"roboto"}}> <b>+{this.state.total.aChanges} </b> </h6> | ||
</div> | ||
<div class="card" style={{margin: "30px 50px"}}> | ||
<h4 style={{ fontFamily: "roboto", marginTop:"20px" }}> Recovered </h4> | ||
<h3 style={{color: "green" , fontFamily:"roboto" }}> | ||
{this.state.total.recovered} | ||
</h3> | ||
<h6 style={{color: "green" , marginBottom:"20px" , fontFamily:"roboto"}}> <b>+{this.state.total.rChanges} </b> </h6> | ||
</div> | ||
<div class="card" style={{margin: "30px 50px"}}> | ||
<h4 style={{ fontFamily: "roboto", marginTop:"20px" }}> Deaths </h4> | ||
<h3 style={{color: "darkgrey" , fontFamily:"roboto"}}> | ||
{this.state.total.deaths} | ||
</h3> | ||
<h6 style={{color: "darkgrey" , marginBottom:"20px" , fontFamily:"roboto"}}><b>+{this.state.total.dChanges} </b> </h6> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default map; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.