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-12-07 04:02:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4203006c586a22eea3bc22f7fa1ebafaae5327d9
4203006c
1 parent
b6a4c02d
[ADD] progressBar 추가, 이후 아이콘 커스텀 예정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
src/pages/SurveyPage.js
src/pages/SurveyPage.js
View file @
4203006
...
...
@@ -2,33 +2,60 @@ import React, { useState, useEffect } from "react";
import
Card
from
"../components/card/Card"
;
import
{
useDispatch
}
from
'react-redux'
;
import
{
getResultThunk
}
from
"../store/action/result"
;
import
ProgressBar
from
"../components/progressbar/ProgressBar"
;
import
"antd/dist/antd.css"
;
import
mainPattern
from
"../assets/mainPattern.jpeg"
;
import
styled
,
{
css
}
from
"styled-components"
;
const
SurveyContainer
=
styled
.
div
`
display: flex;
justify-content: center;
background-image: url(
${
mainPattern
}
);
`
;
const
Container
=
styled
.
div
`
border: solid 1px red;
/* border: solid 1px red; */
width: 500px;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
`
;
const
ProgressBar
=
styled
.
div
`
display: flex;
align-items: center;
width: 300px;
padding: 0.25rem;
margin-top: 14rem;
background-color: #747b4b;
border-radius: 1rem;
position: relative;
`
;
// 적당한 icon 찾으면 바꿀 것임
const
ProgressIcon
=
styled
.
div
`
position: absolute;
width: 25px;
height: 25px;
border-radius: 50%;
background-color: #3c441d;
${(
props
)
=>
css
`
transform: translateX(
${
30
*
props
.
curIdx
}
px);
transition: 0.5s;
`
}
`
;
const
SliderCotainer
=
styled
.
div
`
width: 100%;
display: flex;
align-items: center;
/* margin: 0 auto; */
${(
props
)
=>
css
`
transform: translateX(
${
-
500
*
props
.
curIdx
}
px);
transition: 0.5s;
`
}
margin-top:
20
rem;
margin-top:
6
rem;
`
;
function
SurveyPage
({
history
,
question
})
{
...
...
@@ -47,6 +74,9 @@ function SurveyPage({ history, question }) {
<
SurveyContainer
>
<
Container
>
{
/* 상태바 넣기 */
}
<
ProgressBar
>
<
ProgressIcon
curIdx
=
{
curIdx
}
/
>
<
/ProgressBar
>
<
SliderCotainer
curIdx
=
{
curIdx
}
>
{
/* 얘가 슬라이더 컨테이너 */
}
{
question
.
map
((
question
)
=>
(
...
...
Please
register
or
login
to post a comment