doc: add mapCenter and mapZoom state and pass them as props

This commit is contained in:
Leon Xu committed 2022-05-03 15:08:18 -07:00
1 parent e8b23a4595
commit 4ac02574d4
1 file changed
+3 -1
+3 -1
View File
@@ -20,6 +20,8 @@ function App() {
const [countryInfo, setCountryInfo] = useState({});
const [casesType, setCasesType] = useState("cases");
const [tableData, setTableData] = useState([]);
const [mapCenter, setMapCenter] = useState({ lat: 34.80746, lng: -40.4796 });
const [mapZoom, setMapZoom] = useState(3);
useEffect(() => {
fetch("https://disease.sh/v3/covid-19/all")
@@ -96,7 +98,7 @@ function App() {
/>
</section>
<Map />
<Map center={mapCenter} zoom={mapZoom} />
</article>
<Card className="app__right">
<CardContent>