Files
goTorrent/goTorrentWebUI/node_modules/material-ui/List/ListItemIcon.js.flow

45 lines
1.1 KiB
Plaintext

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
height: 24,
marginRight: theme.spacing.unit * 2,
width: 24,
color: theme.palette.action.active,
flexShrink: 0,
},
});
/**
* A simple wrapper to apply `List` styles to an `Icon` or `SvgIcon`.
*/
function ListItemIcon(props) {
const { children, classes, className: classNameProp, ...other } = props;
return React.cloneElement(children, {
className: classNames(classes.root, classNameProp, children.props.className),
...other,
});
}
ListItemIcon.propTypes = {
/**
* The content of the component, normally `Icon`, `SvgIcon`,
* or a `material-ui-icons` SVG icon component.
*/
children: PropTypes.element.isRequired,
/**
* Useful to extend the style applied to components.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
};
export default withStyles(styles, { name: 'MuiListItemIcon' })(ListItemIcon);