Added new ToggleSwitch component

This commit is contained in:
Alejandro Celaya
2020-07-14 16:05:00 +02:00
parent 2d96c21b50
commit a675d60d59
4 changed files with 35 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ import { fillTheGaps } from '../../utils/helpers/visits';
import './LineChartCard.scss';
import { useToggle } from '../../utils/helpers/hooks';
import { rangeOf } from '../../utils/utils';
import Checkbox from '../../utils/Checkbox';
import ToggleSwitch from '../../utils/ToggleSwitch';
const propTypes = {
title: PropTypes.string,
@@ -167,9 +167,9 @@ const LineChartCard = ({ title, visits, highlightedVisits, highlightedLabel = 'S
</UncontrolledDropdown>
</div>
<div className="float-right mr-2">
<Checkbox checked={skipNoVisits} onChange={toggleSkipNoVisits}>
<ToggleSwitch checked={skipNoVisits} onChange={toggleSkipNoVisits}>
<small>Skip dates with no visits</small>
</Checkbox>
</ToggleSwitch>
</div>
</CardHeader>
<CardBody className="line-chart-card__body">