Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ProgressBar and BackButton Components #129

Merged
merged 6 commits into from
Sep 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions web/components/atoms/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
interface Props {
color?: string;
/** A number between 0 and 100 indicating the progress percentage */
progress: number;
}

export default function ProgressBar({
color,
progress
}: Props) {
return (
<div className="h-[6px] relative rounded-full">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add the gray on the other side of the progress bar? I think you can just add bg-[color] to this div, and you can add the gray color to web/tailwind.config.js too so that it can be easily reused and updated!

<div style={{ backgroundColor: color, width: `${progress}%` }} className="rounded-full absolute top-0 left-0 bottom-0 transition-all" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how you made color a variable in case we want to have different colors in the future, but I think it'll only be MBB's pink, so you can statically set this color as "bg-mbb-pink" in Tailwind since we define "mbb-pink" in web/tailwind.config.js!

</div>
)
}
Loading