react-toolbox/components/list/ListItemAction.js

23 lines
518 B
JavaScript
Raw Normal View History

2016-04-09 21:34:34 +03:00
import React, { PropTypes } from 'react';
import style from './style';
const ListItemAction = ({action}) => {
const {onClick, onMouseDown} = action.props;
const stopRipple = onClick && !onMouseDown;
const stop = e => e.stopPropagation();
return (
<span className={style.itemAction} onMouseDown={stopRipple && stop} onClick={onClick && stop}>
{action}
</span>
);
};
ListItemAction.propTypes = {
2016-04-09 21:34:34 +03:00
action: PropTypes.object
};
ListItemAction.defaultProps = {
};
export default ListItemAction;