Skip to content

Commit

Permalink
✨ feat: funnel 패턴 구성 및 첫 step 추가 #5
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMirror21 committed Oct 18, 2024
1 parent d2066c1 commit ad4151d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/pages/Information/InformationPage.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
import InformationStep from '@/components/Information/InformationStep';
import StepIndicator from '@/components/Information/StepIndicator';
import {
initialUserInfoRequestBody,
UserInfoRequestBody,
} from '@/types/api/users';
import { useState } from 'react';

const InformationPage = () => {
const [currentStep, setCurrentStep] = useState(1);
const [userInfo, setUserInfo] = useState<UserInfoRequestBody>(
initialUserInfoRequestBody,
);

const handleNext = (newInfo: UserInfoRequestBody) => {
setUserInfo(newInfo);
setCurrentStep((prev) => prev + 1);
};
return (
<div className="m-auto max-w-[500px] h-screen flex flex-col items-center justify-start border border-black">
<div className="m-auto max-w-[500px] py-6 h-screen flex flex-col items-center justify-start border border-black">
<div className="w-full flex flex-row items-center justify-between">
<div className="relative w-full flex items-center justify-center text-[1.75rem] tracking-[-0.01em] leading-9 font-semibold font-[Pretendard] text-[#1e1926] text-left" onClick={() => setCurrentStep(currentStep + 1)}>
<div
className="relative w-full flex items-center justify-center text-[1.75rem] tracking-[-0.01em] leading-9 font-semibold font-[Pretendard] text-[#1e1926] text-left"
onClick={() => setCurrentStep(currentStep + 1)}
>
Information
</div>
<StepIndicator currentStep={currentStep} />
</div>
{currentStep === 1 && (
<InformationStep userInfo={userInfo} onNext={handleNext} />
)}
</div>
);
};
Expand Down

0 comments on commit ad4151d

Please sign in to comment.