sdy

update menu style and get confirmed data

import React from "react";
import React, {useEffect, useState} from "react";
import axios from "axios";
const getAcc = async () => {
const res = await axios.get("/api/watson/corona");
return res.data.response.body.items.item.decideCnt;
}
const Menu = () => {
const [acc, setAcc] = useState(0);
useEffect(() => {
getAcc().then(data => {
setAcc(data)
}).catch(e => {
console.log("e : ", e);
})
}, []);
return (
<div className="menu-box">
<div className="menu-header">
......@@ -9,6 +24,21 @@ const Menu = () => {
</div>
<div className="menu-contents">
<div className="menu-item">
<div className="pic bar"></div>
<div className="corona-cnt-box">
<a href="http://ncov.mohw.go.kr/">
<div className="corona-cnt-today">
<span> 금일 확진자 </span>
<span className="cnt"> 541 </span>
</div>
<div className="corona-cnt-acc">
<span> 누적 확진자 </span>
<span className="cnt">{acc}</span>
</div>
</a>
</div>
</div>
<div className="menu-item">
<div className="pic call"></div>
<a href="tel:+821339">질병 관리청 콜센터 1339</a>
</div>
......@@ -17,10 +47,6 @@ const Menu = () => {
<a href="http://ncov.mohw.go.kr/baroView4.do">코로나 예방 수칙</a>
</div>
<div className="menu-item">
<div className="pic bar"></div>
<a href="">확진현황 (axios )</a>
</div>
<div className="menu-item">
<div className="pic vaccine"></div>
<a href="https://ncv.kdca.go.kr/menu.es?mid=a10117030000">백신 접종 정보</a>
</div>
......