-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feature/filter for test patients (#192) * recipients I am following checkbox functionality bugfix * Allow filtering by test patients * remove un-intended changes * link and black fixes * black fix * fix based on feedback --------- Co-authored-by: Amy Chen <clone@cesium.cirg.washington.edu> * bugFix - TypeError related to Date object --------- Co-authored-by: Amy Chen <achen2401@gmail.com> Co-authored-by: Amy Chen <clone@cesium.cirg.washington.edu>
- Loading branch information
1 parent
925cfd6
commit 8d06802
Showing
5 changed files
with
93 additions
and
6 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,54 @@ | ||
import { makeStyles } from "@material-ui/core/styles"; | ||
import PropTypes from "prop-types"; | ||
import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||
import Checkbox from "@material-ui/core/Checkbox"; | ||
import Typography from "@material-ui/core/Typography"; | ||
|
||
const checkBoxStyles = makeStyles((theme) => { | ||
return { | ||
root: { | ||
color: theme.palette.primary.main, | ||
}, | ||
}; | ||
}); | ||
const formControlStyles = makeStyles((theme) => { | ||
return { | ||
root: { | ||
backgroundColor: "#f7f7f7", | ||
marginLeft: theme.spacing(1), | ||
marginRight: theme.spacing(1) | ||
}, | ||
}; | ||
}); | ||
|
||
export default function TestPatientsCheckbox({ label, changeEvent }) { | ||
const checkboxClasses = checkBoxStyles(); | ||
const formControlClasses = formControlStyles(); | ||
const handleChange = (event) => { | ||
if (changeEvent) changeEvent(event.target.checked); | ||
}; | ||
return ( | ||
<FormControlLabel | ||
classes={{ | ||
root: formControlClasses.root, | ||
}} | ||
control={ | ||
<Checkbox | ||
onChange={handleChange} | ||
name="ckTestPatients" | ||
color="primary" | ||
size="small" | ||
classes={{ | ||
root: checkboxClasses.root, | ||
}} | ||
/> | ||
} | ||
label={<Typography variant="body2">{label}</Typography>} | ||
/> | ||
); | ||
} | ||
|
||
TestPatientsCheckbox.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
changeEvent: PropTypes.func, | ||
}; |
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