2016-03-29 16:41:24 +08:00
|
|
|
import {Actions, React, ReactDOM} from 'nylas-exports';
|
2016-03-25 01:42:44 +08:00
|
|
|
import {RetinaImg} from 'nylas-component-kit';
|
|
|
|
|
|
|
|
import EmojiButtonPopover from './emoji-button-popover';
|
|
|
|
|
|
|
|
|
|
|
|
class EmojiButton extends React.Component {
|
|
|
|
static displayName = 'EmojiButton';
|
|
|
|
|
2016-05-06 13:30:34 +08:00
|
|
|
onClick = () => {
|
2016-03-29 16:41:24 +08:00
|
|
|
const buttonRect = ReactDOM.findDOMNode(this).getBoundingClientRect();
|
2016-03-25 01:42:44 +08:00
|
|
|
Actions.openPopover(
|
|
|
|
<EmojiButtonPopover />,
|
|
|
|
{originRect: buttonRect, direction: 'up'}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2016-09-01 00:56:09 +08:00
|
|
|
<button tabIndex={-1} className="btn btn-toolbar btn-emoji" title="Insert emoji…" onClick={this.onClick}>
|
2016-05-07 05:10:56 +08:00
|
|
|
<RetinaImg name="icon-composer-emoji.png" mode={RetinaImg.Mode.ContentIsMask} />
|
2016-03-25 01:42:44 +08:00
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EmojiButton.containerStyles = {
|
|
|
|
order: 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default EmojiButton;
|