import React from 'react';
import PropTypes from 'prop-types';
import { autobind } from 'core-decorators';
import { Popover, Position, Button } from "@blueprintjs/core";


@autobind
class MenuButton extends React.Component {
	static propTypes = {
		menu: PropTypes.element,
		iconName: PropTypes.string,
		text: PropTypes.string,
		loading: PropTypes.bool,
		buttonClass: PropTypes.string,
		position: PropTypes.oneOf(Object.keys(Position).map(
			(value) => {
				let num = parseInt(value);
				if (isNaN(num)) return value;
				else return num;
			}
		))
	}

	static defaultProps = {
		loading: false,
		position: Position.BOTTOM_RIGHT
	}

	render() {
		return (
			<Popover content={this.props.menu} position={this.props.position} isDisabled={this.props.loading}>
				<Button 
					type='button' 
					loading={this.props.loading}
					className={this.props.buttonClass} 
					iconName={this.props.iconName}
				>
					{this.props.text}
				</Button>
			</Popover>
		);
	}
}


export default MenuButton;

@@ -383,16 +383,50 @@
 string,%0A
+%09%09popoverClass: PropTypes.string,%0A
 %09%09positi
@@ -703,16 +703,52 @@
 %3CPopover
+ className=%7Bthis.props.popoverClass%7D
  content

Add support for a class to be applied to the Popover component