MainPage.js
1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React,{useEffect, useState} from 'react';
import './MainPage.scss';
import ProgressBar from "../components/progressbar/ProgressBar";
import {Button} from "antd";
import axios from 'axios';
import mainImg from "../assets/main-soldier.png";
import {getSurvey,getSurveySuccess,getSurveyError} from '../store/action/survey';
function MainPage({history}){
//const [percent,setPercent] = useState(0);
const onClick = () => {
history.push('/survey');
}
useEffect(()=>{
// const getApi = async() =>{
// dispatch(getSurvey());
// try{
// const {data} = await axios.get("getquestions");
// setQuestion(data);
// dispatch(getSurveySuccess(data));
// }catch(e){
// dispatch(getSurveyError(e));
// }
// }
// getApi();
const getApi = async()=>{
const {data} = await axios.get("getquestions");
localStorage.setItem('question',JSON.stringify(data));
}
getApi();
},[]);
return(
<>
<div className="main-wrapper">
<div className="main-title">KHUSAT</div>
<div className="main-title__desc">
KHUSAT 특별과정, <br></br>
여러분의 보직을 추천드립니다.
</div>
{/* <ProgressBar percent={percent}/> */}
<Button
size="large"
onClick={onClick}
color="#536349"
style={{}}
> 시작하기</Button>
<img className="main-image" src={mainImg}/>
</div>
</>
);
}
export default MainPage;