Skip to content

Commit 27fc657

Browse files
committed
design : Funnel 방식의 단계 이동 버튼 스타일 변경
1 parent 3a6c2de commit 27fc657

File tree

2 files changed

+20
-33
lines changed

2 files changed

+20
-33
lines changed

src/pages/user/apply/ApplyStep.styled.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import styled from 'styled-components';
2-
import Button from '../../../components/common/Button/Button';
32

43
export const Container = styled.div`
54
max-width: 100%;
@@ -46,9 +45,10 @@ export const StepContainer = styled.div`
4645

4746
export 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

5454
export 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-
`;

src/pages/user/apply/ApplyStep.tsx

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)