mirror of
https://github.com/kevinsqi/react-circular-progressbar.git
synced 2026-01-25 16:03:15 +00:00
click button to toggle extended examples
This commit is contained in:
parent
fe5370c76d
commit
3df9aa545d
@ -14,6 +14,8 @@ const Example: React.FunctionComponent<{ description: string }> = ({ description
|
||||
);
|
||||
|
||||
function Demo() {
|
||||
const [showAllExamples, setShowAllExamples] = React.useState(false);
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
<div className="row mt-5">
|
||||
@ -97,13 +99,25 @@ function Demo() {
|
||||
</div>
|
||||
</Example>
|
||||
|
||||
<Example description="Dashboard style.">
|
||||
<CircularProgressbar percentage={50} circleRatio={0.7} />
|
||||
</Example>
|
||||
|
||||
<Example description="Dashboard style, counterclockwise.">
|
||||
<CircularProgressbar percentage={50} circleRatio={0.7} counterClockwise />
|
||||
</Example>
|
||||
{showAllExamples ? (
|
||||
<React.Fragment>
|
||||
<Example description="Dashboard style.">
|
||||
<CircularProgressbar percentage={50} circleRatio={0.7} />
|
||||
</Example>
|
||||
<Example description="Dashboard style, counterclockwise.">
|
||||
<CircularProgressbar percentage={50} circleRatio={0.7} counterClockwise />
|
||||
</Example>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<div className="col-12 text-center">
|
||||
<button
|
||||
className="btn btn-link text-secondary"
|
||||
onClick={() => setShowAllExamples(true)}
|
||||
>
|
||||
<small>Show more examples</small>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user