From 90f7d7f60694701217eb29ca42fa977f4ac860dc Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 16 Aug 2024 00:58:42 +0100 Subject: [PATCH] Refactor stepper --- src/components/Projects/ProjectStepper.tsx | 46 ++++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/src/components/Projects/ProjectStepper.tsx b/src/components/Projects/ProjectStepper.tsx index 009a3bb14..526d3b7cd 100644 --- a/src/components/Projects/ProjectStepper.tsx +++ b/src/components/Projects/ProjectStepper.tsx @@ -24,7 +24,7 @@ function StepperAction(props: StepperActionProps) { if (isActive) { return ( - @@ -66,6 +66,32 @@ function StepperStepSeparator(props: StepperStepSeparatorProps) { ); } +type MilestoneStepProps = { + icon: LucideIcon; + text: string; + isCompleted?: boolean; +}; + +function MilestoneStep(props: MilestoneStepProps) { + const { icon: DisplayIcon, text, isCompleted } = props; + + if (isCompleted) { + return ( + + + {text} + + ); + } + + return ( + + + {text} + + ); +} + export function ProjectStepper() { const stickyElRef = useRef(null); const [isSticky, setIsSticky] = useState(false); @@ -107,28 +133,22 @@ export function ProjectStepper() {
- + - -
- + + +
);