-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:WebmasterCamp/ywc19-hackathon-d
- Loading branch information
Showing
5 changed files
with
152 additions
and
41 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,22 +1,30 @@ | ||
import { type FC } from "react" | ||
import { type FC } from 'react' | ||
|
||
import Link from 'next/link' | ||
|
||
export interface StepItemProps { | ||
prompt: string, | ||
step: number | undefined, | ||
active?: boolean | ||
prompt: string | ||
step: number | ||
active?: boolean | ||
} | ||
|
||
const StepItem: FC<StepItemProps> = ({ prompt, step, active = false }) => { | ||
return ( | ||
<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 ${active ? "outline-teal-700 outline-2 outline-offset-4 outline" : "outline-2"}`}> | ||
{step} | ||
</h5> | ||
</div> | ||
<h2>{prompt}</h2> | ||
</div> | ||
) | ||
return ( | ||
<Link href={`/expenses/${step}`}> | ||
<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 ${ | ||
active ? 'outline-teal-700 outline-2 outline-offset-4 outline' : 'outline-2' | ||
}`} | ||
> | ||
{step} | ||
</h5> | ||
</div> | ||
<h2>{prompt}</h2> | ||
</div> | ||
</Link> | ||
) | ||
} | ||
|
||
export { StepItem } | ||
export { StepItem } |
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 |
---|---|---|
@@ -1,16 +1,23 @@ | ||
import { type FC } from "react"; | ||
import { StepItem, type StepItemProps } from "./StepItem"; | ||
import { type FC } from 'react' | ||
|
||
export interface StepsProps { items: StepItemProps[] } | ||
import { StepItem, type StepItemProps } from './StepItem' | ||
|
||
export const Steps: FC<StepsProps> = ({ items }) => { | ||
return ( | ||
<div className="flex justify-center items-center gap-x-4"> | ||
{ | ||
items.map((item, index) => ( | ||
<StepItem key={index} active={item.active} prompt={item.prompt} step={item.step} /> | ||
)) | ||
} | ||
</div> | ||
) | ||
} | ||
export interface StepsProps { | ||
items: StepItemProps[] | ||
activeStep: number | ||
} | ||
|
||
export const Steps: FC<StepsProps> = ({ items, activeStep }) => { | ||
return ( | ||
<div className="flex justify-center items-center gap-x-20"> | ||
{items.map((item, index) => ( | ||
<StepItem | ||
key={index} | ||
active={item.step === activeStep} | ||
prompt={item.prompt} | ||
step={item.step} | ||
/> | ||
))} | ||
</div> | ||
) | ||
} |
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
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