Toggle navigation
Toggle navigation
This project
Loading...
Sign in
khusat
/
khusat-front
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
이준호
2020-11-14 06:22:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c5af9929b75e8ffc9a17d6d54299334c76e225ed
c5af9929
1 parent
88e26950
feat: result page 디자인 제외 구현 완료
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
84 additions
and
16 deletions
package.json
src/assets/main-soldier.png
src/assets/work1.png
src/index.js
src/pages/MainPage.js
src/pages/MainPage.scss
src/pages/ResultPage.js
src/pages/ResultPage.scss
src/pages/SurveyPage.js
src/pages/SurveyPage.scss
src/store/action/result.js
yarn.lock
package.json
View file @
c5af992
...
...
@@ -17,6 +17,7 @@
"react-scripts"
:
"4.0.0"
,
"redux"
:
"^4.0.5"
,
"redux-devtools-extension"
:
"^2.13.8"
,
"redux-thunk"
:
"^2.3.0"
,
"sass-loader"
:
"^10.1.0"
,
"styled-components"
:
"^5.2.1"
,
"swiper"
:
"^6.3.5"
,
...
...
src/assets/main-soldier.png
0 → 100644
View file @
c5af992
1.16 MB
src/assets/work1.png
0 → 100644
View file @
c5af992
2.61 MB
src/index.js
View file @
c5af992
...
...
@@ -7,11 +7,12 @@ import 'antd/dist/antd.css'
// import redux
import
{
Provider
}
from
"react-redux"
;
import
{
createStore
}
from
"redux"
;
import
{
createStore
,
applyMiddleware
}
from
"redux"
;
import
rootReducer
from
"./store/index"
;
import
Thunk
from
'redux-thunk'
;
import
{
composeWithDevTools
}
from
"redux-devtools-extension"
;
const
store
=
createStore
(
rootReducer
,
composeWithDevTools
);
const
store
=
createStore
(
rootReducer
,
composeWithDevTools
(
applyMiddleware
(
Thunk
))
);
ReactDOM
.
render
(
<
Provider
store
=
{
store
}
>
...
...
@@ -21,4 +22,4 @@ ReactDOM.render(
<
/Provider>
,
document
.
getElementById
(
'root'
)
);
reportWebVitals
();
reportWebVitals
();
\ No newline at end of file
...
...
src/pages/MainPage.js
View file @
c5af992
...
...
@@ -2,9 +2,10 @@ import React,{useState} from 'react';
import
'./MainPage.scss'
;
import
ProgressBar
from
"../components/progressbar/ProgressBar"
;
import
{
Button
}
from
"antd"
;
import
mainImg
from
"../assets/main-soldier.png"
;
function
MainPage
({
history
}){
const
[
percent
,
setPercent
]
=
useState
(
3
0
);
//const [percent,setPercent] = useState(
0);
const
onClick
=
()
=>
{
history
.
push
(
'/survey'
);
}
...
...
@@ -17,11 +18,13 @@ function MainPage({history}){
KHUSAT
특별과정
,
<
br
><
/br
>
여러분의
보직을
추천드립니다
.
<
/div
>
<
ProgressBar
percent
=
{
percent
}
/
>
{
/* <ProgressBar percent={percent}/> */
}
<
Button
size
=
"large"
onClick
=
{
onClick
}
color
=
"#536349"
>
시작하기
<
/Button
>
<
img
className
=
"main-image"
src
=
{
mainImg
}
/
>
<
/div
>
<
/
>
);
...
...
src/pages/MainPage.scss
View file @
c5af992
...
...
@@ -5,6 +5,13 @@
// max-width: 50rem;
}
.main-image
{
margin-top
:
2rem
;
width
:
70rem
;
height
:
35rem
;
border-radius
:
1rem
;
}
.main-title
{
margin-top
:
5rem
;
text-align
:
center
;
...
...
@@ -12,6 +19,7 @@
font-weight
:
bold
;
&
__desc
{
margin-top
:
2rem
;
margin-bottom
:
2rem
;
font-size
:
1
.5rem
;
}
}
...
...
src/pages/ResultPage.js
View file @
c5af992
import
React
from
'react'
;
import
{
useSelector
}
from
'react-redux'
;
import
'./ResultPage.scss'
;
function
ResultPage
(){
const
data
=
useSelector
(
state
=>
state
.
result
.
data
);
return
(
<>
결과
페이지
입니다
.
<
/
>
<
div
className
=
"container"
>
{
data
&&
(
<
div
className
=
"result"
>
<
div
className
=
"result__title"
>
{
data
.
high
}
<
/div
>
<
div
className
=
"result__position"
>
{
data
.
low
}
<
/div
>
<
div
className
=
"result__desc"
>
{
data
.
description
}
<
/div
>
<
div
><
img
src
=
{
data
.
image
}
/></
div
>
<
/div
>
)}
<
/div
>
);
}
...
...
src/pages/ResultPage.scss
View file @
c5af992
// .container{
// background-color:#536349;
// }
.result
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
margin-top
:
10rem
;
&
__title
{
font-size
:
5rem
;
font-weight
:
bold
;
}
&
__position
{
font-size
:
4
.5rem
;
}
&
__desc
{
margin-top
:
4rem
;
font-size
:
1
.4rem
;
}
}
\ No newline at end of file
...
...
src/pages/SurveyPage.js
View file @
c5af992
...
...
@@ -3,18 +3,21 @@ import Card from "../components/card/Card";
import
ProgressBar
from
"../components/progressbar/ProgressBar"
;
import
axios
from
'axios'
;
import
"./SurveyPage.scss"
;
import
'antd/dist/antd.css'
// import redux
import
{
useDispatch
}
from
'react-redux'
;
import
{
getResult
,
getResultSuccess
,
getResultError
}
from
'../store/action/result'
;
function
SurveyPage
({
history
})
{
const
[
curIdx
,
setCurIdx
]
=
useState
(
0
);
const
[
question
,
setQuestion
]
=
useState
([]);
const
[
answer
,
setAnswer
]
=
useState
([]);
const
[
respond
,
setRespond
]
=
useState
([]
);
const
[
answer
,
setAnswer
]
=
useState
([]);
const
dispatch
=
useDispatch
(
);
useEffect
(()
=>
{
const
getApi
=
async
()
=>
{
const
{
data
}
=
await
axios
.
get
(
"getquestions"
);
setQuestion
(
data
);
// console.log(question);
}
getApi
();
},[]);
...
...
@@ -22,10 +25,14 @@ function SurveyPage({history}) {
useEffect
(()
=>
{
if
(
curIdx
===
10
){
const
postApi
=
async
()
=>
{
const
{
data
}
=
await
axios
.
post
(
"submit"
,
answer
);
console
.
log
(
data
);
setRespond
(
data
);
dispatch
(
getResult
);
try
{
const
{
data
}
=
await
axios
.
post
(
"submit"
,
answer
);
console
.
log
(
data
);
dispatch
(
getResultSuccess
(
data
));
}
catch
(
e
){
dispatch
(
getResultError
(
e
));
}
}
postApi
();
history
.
push
(
'/result'
);
...
...
src/pages/SurveyPage.scss
View file @
c5af992
...
...
@@ -4,6 +4,10 @@
justify-content
:
center
;
align-items
:
center
;
margin-top
:
10rem
;
&
__progress
{
margin-bottom
:
3rem
;
}
}
.slider
{
...
...
@@ -12,7 +16,7 @@
display
:
flex
;
align-items
:
center
;
margin
:
0
;
//
overflow: hidden;
overflow
:
hidden
;
&
__wrapper
{
border
:
1px
solid
red
;
...
...
src/store/action/result.js
View file @
c5af992
...
...
@@ -40,6 +40,8 @@ function result(
error
:
action
.
payload
}
}
default
:
return
state
;
}
}
...
...
yarn.lock
View file @
c5af992
...
...
@@ -10238,6 +10238,11 @@ redux-devtools-extension@^2.13.8:
resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.8.tgz#37b982688626e5e4993ff87220c9bbb7cd2d96e1"
integrity sha512-8qlpooP2QqPtZHQZRhx3x3OP5skEV1py/zUdMY28WNAocbafxdG2tRD1MWE7sp8obGMNYuLWanhhQ7EQvT1FBg==
redux-thunk@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==
redux@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f"
...
...
Please
register
or
login
to post a comment