Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design2
/
2017110273
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2021-06-06 17:42:42 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
69266df9cbc5a9cd7bb64d6f1e70546cfbb11c11
69266df9
1 parent
e7ee524a
update menu style and get confirmed data
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
client/src/components/menu/Menu.js
client/src/components/menu/Menu.js
View file @
69266df
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
>
...
...
Please
register
or
login
to post a comment