Closed Akikaze1119 closed 2 weeks ago
The task is to create a shared UI component for steps indicator.
steps indicator
Created steps indicator component based on figma
▼Figma
▼Code https://github.com/Tascurator/tascurator-frontend/assets/132441773/7ce8df02-e98a-4420-8c11-84dc2ec22c69
I used hard code for setting the height of the horizontal bar.
h-1 (4px)
Since 'stepper' seems to be more common, both the file name and the component name are set to 'stepper'. Reference
The following code can be used for review.
'use client'; import { useState } from 'react'; import { Stepper } from '@/components/ui/stepper'; import { Button } from '@/components/ui/button'; const INITIAL_STEP = 1; const MAX_STEPS = 4; export default function Home() { const [currentStep, setCurrentStep] = useState(INITIAL_STEP); return ( <> <main className="flex min-h-screen flex-col items-center p-6"> <Stepper currentStep={currentStep} maxSteps={MAX_STEPS} /> <div className="flex mt-10 gap-4"> <Button size="sm" onClick={() => setCurrentStep((prev) => prev - 1)} disabled={currentStep === INITIAL_STEP} > Previous </Button> <Button size="sm" onClick={() => setCurrentStep((prev) => prev + 1)} disabled={currentStep === MAX_STEPS} > Next </Button> </div> </main> </> ); }
@KaiKoide Thank you for your review! I modified codes.
Overview
The task is to create a shared UI component for
steps indicator
.Changes
Created
steps indicator
component based on figmaScreenshots or videos
▼Figma
▼Code https://github.com/Tascurator/tascurator-frontend/assets/132441773/7ce8df02-e98a-4420-8c11-84dc2ec22c69
Notes
About bar style
I used hard code for setting the height of the horizontal bar.
h-1 (4px)
, which is too long for the bar.About the name
Since 'stepper' seems to be more common, both the file name and the component name are set to 'stepper'. Reference
About the confirmation code
The following code can be used for review.
Assignee Checklist:
Reviewer Checklist: