Skip to content

Commit

Permalink
add: steps
Browse files Browse the repository at this point in the history
  • Loading branch information
DrowningToast committed Jul 16, 2023
1 parent 492e2b7 commit 8152c19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Step/StepItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export interface StepItemProps {

const StepItem: FC<StepItemProps> = ({ prompt, step, active = false }) => {
return (
<div className={`flex flex-col gap-y-2 ${active ? "outline-teal-700" : ""} text-center`}>
<div className={`flex flex-col gap-y-2 text-center`}>
<div>
<h5 className="inline-block w-fit p-2 rounded-full font-noto text-white text-lg bg-teal-500">
<h5 className={`inline-block w-fit p-2 rounded-full font-noto text-white text-lg bg-teal-500 ${active ? "outline-teal-700 outline-2 outline-offset-4 outline" : "outline-2"}`}>
{step}
</h5>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Step/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Steps: FC<StepsProps> = ({ items }) => {
<div className="flex justify-center items-center gap-x-4">
{
items.map((item, index) => (
<StepItem key={index} active prompt={item.prompt} step={index} />
<StepItem key={index} active={item.active} prompt={item.prompt} step={index} />
))
}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/expenses/1/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Steps, type StepsProps } from '~/components/Step/Steps'
const steps: StepsProps["items"] = [
{
prompt: "กรอกข้อมูลรายได้",
step: 1
step: 1,
active: true
},
{
prompt: "วางแผนการเงิน",
Expand Down

0 comments on commit 8152c19

Please sign in to comment.