mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-13 21:24:58 +08:00
29 lines
638 B
React
29 lines
638 B
React
|
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 {
|
||
|
|
||
|
onClick = (event) => {
|
||
|
event.stopPropagation()
|
||
|
const buttonRect = ReactDOM.findDOMNode(this).getBoundingClientRect()
|
||
|
Actions.openPopover(
|
||
|
<QuickEventPopover />,
|
||
|
{originRect: buttonRect, direction: 'down'}
|
||
|
)
|
||
|
};
|
||
|
|
||
|
render() {
|
||
|
return (
|
||
|
<button
|
||
|
tabIndex={-1}
|
||
|
className="btn btn-toolbar"
|
||
|
onClick={this.onClick}
|
||
|
>
|
||
|
+
|
||
|
</button>
|
||
|
);
|
||
|
}
|
||
|
}
|