-
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.
X2-6577 | Improvements for Tutorials - Drawer, DotProgress, Modal Pos…
…itioning (#250)
- Loading branch information
Showing
22 changed files
with
547 additions
and
95 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
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, | ||
}; |
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
Oops, something went wrong.