-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
704 additions
and
126 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,25 @@ | ||
import { range } from "lodash"; | ||
import PropTypes from "prop-types"; | ||
import React from "react"; | ||
import { Dot } from "./Dot"; | ||
|
||
export const DotProgress = ({ current, total }) => { | ||
if (total <= 1) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="w-full space-x-2 text-center"> | ||
{range(0, total).map((index) => { | ||
const currentValue = current <= 0 ? 0 : current >= total ? current - 1 : current; | ||
const color = index === currentValue ? "primary" : "secondary"; | ||
return <Dot key={index} color={color} size="medium" />; | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
DotProgress.propTypes = { | ||
total: PropTypes.number.isRequired, | ||
current: PropTypes.number.isRequired, | ||
}; |
Oops, something went wrong.