All files ContextMenuPopupTrigger.js

100% Statements 5/5
100% Branches 4/4
100% Functions 3/3
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28        29x                   29x       3x 2x   1x            
import React from 'react';
 
class ContextMenuPopupTrigger extends React.Component {
	render() {
		return (
			<div
				className={this.getClassName()}
				onClick={this.handleClick.bind(this)}
				style={this.props.style}
			>{this.props.children}</div>
		)
	}
 
	getClassName() {
		return this.props.className || 'context-menu-popup__trigger';
	}
 
	handleClick() {
		if (this.props.customOnClickHandler) {
			this.props.customOnClickHandler(this.props.contextMenuPopup);
		} else {
			this.props.onClick();
		}
	}
}
 
 
export default ContextMenuPopupTrigger;