doc: add onClick method to use setCasesType

This commit is contained in:
Leon Xu committed 2022-05-03 21:07:24 -07:00
1 parent b5aebb1274
commit b42aab585b
1 file changed
+3
+3
View File
@@ -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)}