react-toolbox/components/list/ListItemText.js

31 lines
790 B
JavaScript
Raw Normal View History

2016-05-29 22:11:04 +03:00
import React, { PropTypes } from 'react';
2016-05-22 20:08:47 +03:00
import classnames from 'classnames';
import { themr } from 'react-css-themr';
2017-01-26 20:05:32 +03:00
import { LIST } from '../identifiers';
2017-01-26 20:05:32 +03:00
const ListItemText = ({ className, primary, children, theme, ...other }) => {
const _className = classnames(theme.itemText, { [theme.primary]: primary }, className);
return (
2016-04-10 12:39:04 +03:00
<span data-react-toolbox="list-item-text" className={_className} {...other}>
{children}
</span>
);
};
ListItemText.propTypes = {
2017-01-26 20:05:32 +03:00
children: PropTypes.node,
2016-05-29 22:11:04 +03:00
className: PropTypes.string,
primary: PropTypes.bool,
theme: PropTypes.shape({
itemText: PropTypes.string,
2017-01-26 20:05:32 +03:00
primary: PropTypes.string,
}),
};
ListItemText.defaultProps = {
2017-01-26 20:05:32 +03:00
primary: false,
};
2016-05-29 21:59:54 +03:00
export default themr(LIST)(ListItemText);
export { ListItemText };