mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
30 lines
710 B
JavaScript
30 lines
710 B
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import {Actions} from 'nylas-exports';
|
|
import QuickEventPopover from './quick-event-popover';
|
|
|
|
export default class QuickEventButton extends React.Component {
|
|
static displayName = "QuickEventButton";
|
|
|
|
onClick = (event) => {
|
|
event.stopPropagation()
|
|
const buttonRect = ReactDOM.findDOMNode(this).getBoundingClientRect()
|
|
Actions.openPopover(
|
|
<QuickEventPopover />,
|
|
{originRect: buttonRect, direction: 'down'}
|
|
)
|
|
};
|
|
|
|
render() {
|
|
return (
|
|
<button
|
|
style={{order: -50}}
|
|
tabIndex={-1}
|
|
className="btn btn-toolbar"
|
|
onClick={this.onClick}
|
|
>
|
|
+
|
|
</button>
|
|
);
|
|
}
|
|
}
|