doc: add onClick method to use setCasesType
This commit is contained in:
1 parent
b5aebb1274
commit
b42aab585b
1 file changed
+3
@@ -86,16 +86,19 @@ function App() {
|
||||
|
||||
<section className="app__stats">
|
||||
<InfoBox
|
||||
onClick={(e) => setCasesType("cases")}
|
||||
title="Coronavirus Cases"
|
||||
cases={prettyPrintStat(countryInfo.todayCases)}
|
||||
total={prettyPrintStat(countryInfo.cases)}
|
||||
/>
|
||||
<InfoBox
|
||||
onClick={(e) => setCasesType("recovered")}
|
||||
title="Recovered "
|
||||
cases={prettyPrintStat(countryInfo.todayRecovered)}
|
||||
total={prettyPrintStat(countryInfo.recovered)}
|
||||
/>
|
||||
<InfoBox
|
||||
onClick={(e) => setCasesType("deaths")}
|
||||
title="Deaths"
|
||||
cases={prettyPrintStat(countryInfo.todayDeaths)}
|
||||
total={prettyPrintStat(countryInfo.deaths)}
|
||||
|
||||
Reference in new issue
Block a user