-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ refactor: 서류 지원 step bar 레이아웃 컴포넌트 분리하기 #41
- Loading branch information
Showing
3 changed files
with
88 additions
and
93 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/components/ApplicationDetail/ApplicationDetailStepBarLayout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
type ApplicationDetailStepBarLayoutProps = { | ||
stepIcon: JSX.Element; | ||
step: number; // 현재 진행 step | ||
currentStep: number; // 레이아웃이 나타내는 step 번호 | ||
title: string; | ||
explain: string; | ||
isLastStep?: boolean; // 마지막 stepBar인지 | ||
}; | ||
|
||
const ApplicationDetailStepBarLayout = ({ | ||
stepIcon, | ||
step, | ||
currentStep, | ||
title, | ||
explain, | ||
isLastStep = false, | ||
}: ApplicationDetailStepBarLayoutProps) => { | ||
return ( | ||
<div className={`flex gap-[1.125rem] ${isLastStep && 'pb-[2.75rem]'}`}> | ||
{isLastStep ? ( | ||
<>{stepIcon}</> | ||
) : ( | ||
<div className="flex flex-col items-center"> | ||
{stepIcon} | ||
<div | ||
className={`w-[0.125rem] h-[3.5rem] ${step > currentStep ? 'bg-[#1E1926]' : 'bg-[#F2F2F2]'}`} | ||
></div> | ||
</div> | ||
)} | ||
<div> | ||
<h5 | ||
className={`${step > currentStep ? 'head-3' : 'body-1'} text-[#464646]`} | ||
> | ||
{title} | ||
</h5> | ||
<p className="caption-2 text-[#656565]">{explain}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ApplicationDetailStepBarLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters