| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 49 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | import React from 'react' |
||
| 2 | import PropTypes from 'prop-types' |
||
| 3 | import clsx from 'clsx' |
||
| 4 | import Toolbar from '@material-ui/core/Toolbar' |
||
| 5 | import Typography from '@material-ui/core/Typography' |
||
| 6 | import IconButton from '@material-ui/core/IconButton' |
||
| 7 | import Tooltip from '@material-ui/core/Tooltip' |
||
| 8 | import DeleteIcon from '@material-ui/icons/Delete' |
||
| 9 | |||
| 10 | 4 | const SelectedToolbar = ({ classes, numSelected }) => ( |
|
| 11 | 2 | <Toolbar |
|
| 12 | className={clsx(classes.root, { |
||
| 13 | [classes.highlight]: numSelected |
||
| 14 | })} |
||
| 15 | > |
||
| 16 | {numSelected ? ( |
||
| 17 | <React.Fragment> |
||
| 18 | <Typography |
||
| 19 | className={classes.title} |
||
| 20 | color="inherit" |
||
| 21 | variant="subtitle1" |
||
| 22 | > |
||
| 23 | {numSelected} selected |
||
| 24 | </Typography> |
||
| 25 | <Tooltip title="Delete"> |
||
| 26 | <IconButton aria-label="delete"> |
||
| 27 | <DeleteIcon /> |
||
| 28 | </IconButton> |
||
| 29 | </Tooltip> |
||
| 30 | </React.Fragment> |
||
| 31 | ) : ( |
||
| 32 | <Typography className={classes.title} variant="h6"> |
||
| 33 | All Posts |
||
| 34 | </Typography> |
||
| 35 | )} |
||
| 36 | </Toolbar> |
||
| 37 | ) |
||
| 38 | |||
| 39 | 4 | SelectedToolbar.propTypes = { |
|
| 40 | numSelected: PropTypes.number.isRequired, |
||
| 41 | classes: PropTypes.shape({ |
||
| 42 | root: PropTypes.string, |
||
| 43 | title: PropTypes.string, |
||
| 44 | highlight: PropTypes.string |
||
| 45 | }) |
||
| 46 | } |
||
| 47 | |||
| 48 | export default SelectedToolbar |
||
| 49 |