bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx
2016-09-01 20:19:37 +00:00

26 lines
578 B
JavaScript
Executable File

import React, { Component, PropTypes } from 'react';
const propTypes = {
children: React.PropTypes.element.isRequired,
};
export default class DropdownTrigger extends Component {
constructor(props) {
super(props);
}
render() {
const { children, handleToggle } = this.props;
const TriggerComponent = React.Children.only(children);
const TriggerComponentBounded = React.cloneElement(TriggerComponent, {
onClick: handleToggle,
'aria-haspopup': true,
});
return TriggerComponentBounded;
}
}
DropdownTrigger.propTypes = propTypes;