react-toolbox/components/list/ListItemText.js

31 lines
828 B
JavaScript
Raw Normal View History

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