react-toolbox/components/list/ListItemText.js

31 lines
785 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';
2016-05-29 21:59:54 +03:00
import { LIST } from '../identifiers.js';
2016-05-22 20:08:47 +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 = {
2016-05-29 22:11:04 +03:00
children: PropTypes.any,
className: PropTypes.string,
primary: PropTypes.bool,
theme: PropTypes.shape({
itemText: PropTypes.string,
primary: PropTypes.string
2016-05-22 20:08:47 +03:00
})
};
ListItemText.defaultProps = {
primary: false
};
2016-05-29 21:59:54 +03:00
export default themr(LIST)(ListItemText);
export { ListItemText };