File tree Expand file tree Collapse file tree 2 files changed +20
-33
lines changed
Expand file tree Collapse file tree 2 files changed +20
-33
lines changed Original file line number Diff line number Diff line change 11import styled from 'styled-components' ;
2- import Button from '../../../components/common/Button/Button' ;
32
43export const Container = styled . div `
54 max-width: 100%;
@@ -46,9 +45,10 @@ export const StepContainer = styled.div`
4645
4746export const StepButton = styled . div `
4847 display: flex;
49- justify-content: left ;
48+ justify-content: center ;
5049 padding-top: 20px;
5150 gap: 20px;
51+ width: 100%;
5252` ;
5353
5454export const StepLabel = styled . div `
@@ -66,9 +66,3 @@ export const StepWrapper = styled.div`
6666 display: flex;
6767 justify-content: space-between;
6868` ;
69-
70- export const SubmitButton = styled ( Button ) `
71- padding: 15px;
72- margin: 0 auto;
73- cursor: pointer;
74- ` ;
Original file line number Diff line number Diff line change @@ -114,7 +114,13 @@ const Apply = () => {
114114 next,
115115 } = useMultiStepForm ( stepList ) ;
116116
117- const handleNextStep = async ( ) => {
117+ const handlePrevStep = ( e : React . MouseEvent ) => {
118+ e . preventDefault ( ) ;
119+ prev ( ) ;
120+ } ;
121+
122+ const handleNextStep = async ( e : React . MouseEvent ) => {
123+ e . preventDefault ( ) ;
118124 const fieldsToValidate = stepFields [ currentStepIndex ] ;
119125 const isValid = await trigger ( fieldsToValidate ) ;
120126 if ( isValid ) {
@@ -165,37 +171,24 @@ const Apply = () => {
165171
166172 < S . StepButton >
167173 < Button
168- size = { 'small ' }
174+ size = { 'primary ' }
169175 schema = { 'primary' }
170176 radius = { 'primary' }
171177 type = 'button'
172- onClick = { prev }
178+ onClick = { handlePrevStep }
173179 >
174180 이전
175181 </ Button >
176- { currentStepIndex !== stepList . length - 1 && (
177- < Button
178- size = { 'small' }
179- schema = { 'primary' }
180- radius = { 'primary' }
181- type = 'button'
182- onClick = { handleNextStep }
183- >
184- 다음
185- </ Button >
186- ) }
187- </ S . StepButton >
188-
189- { isLastStep && (
190- < S . SubmitButton
191- size = 'primary'
192- schema = 'primary'
193- radius = 'primary'
194- type = 'submit'
182+ < Button
183+ size = { 'primary' }
184+ schema = { 'primary' }
185+ radius = { 'primary' }
186+ type = { isLastStep ? 'submit' : 'button' }
187+ onClick = { isLastStep ? undefined : handleNextStep }
195188 >
196- 지원 완료하기
197- </ S . SubmitButton >
198- ) }
189+ { isLastStep ? '지원하기' : '다음' }
190+ </ Button >
191+ </ S . StepButton >
199192 </ form >
200193
201194 < Modal
You can’t perform that action at this time.
0 commit comments