-
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.
Add ProgressBar and BackButton Components (#129)
* Add ProgressBar Component * Add changes to ProgressBar and BackButton * Use colors from tailwind config for back button * remove unnecessary stroke property on chevron * Fix silly little mistake with class names
- Loading branch information
1 parent
43005d0
commit a8905c2
Showing
3 changed files
with
53 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { MouseEventHandler } from "react"; | ||
|
||
interface Props { | ||
onClick?: MouseEventHandler<HTMLButtonElement>; | ||
disabled?: boolean; | ||
} | ||
|
||
export default function BackButton({ onClick, disabled }: Props) { | ||
return ( | ||
<button | ||
className="group flex items-center gap-[2px] text-medium-gray" | ||
onClick={onClick} | ||
disabled={disabled} | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
> | ||
<path | ||
d="M15 18L9 12L15 6" | ||
className={`stroke-medium-gray ${disabled ? "stroke-dark-gray" : "group-hover:stroke-dark-gray"}`} | ||
strokeWidth="3" | ||
strokeLinecap="square" | ||
strokeLinejoin="round" | ||
/> | ||
</svg> | ||
<div | ||
className={`${disabled ? "text-dark-gray" : "group-hover:text-dark-gray"}`} | ||
> | ||
Back | ||
</div> | ||
</button> | ||
); | ||
} |
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,15 @@ | ||
interface Props { | ||
/** A number between 0 and 100 indicating the progress percentage */ | ||
progress: number; | ||
} | ||
|
||
export default function ProgressBar({ progress }: Props) { | ||
return ( | ||
<div className="h-[6px] relative rounded-full bg-empty-gray"> | ||
<div | ||
style={{ width: `${progress}%` }} | ||
className="rounded-full bg-mbb-pink absolute top-0 left-0 bottom-0 transition-all" | ||
/> | ||
</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