Mailspring/packages/client-app/internal_packages/composer-emoji/lib/emoji-button.jsx

32 lines
790 B
React
Raw Normal View History

import {Actions, React, ReactDOM} from 'nylas-exports';
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 = () => {
const buttonRect = ReactDOM.findDOMNode(this).getBoundingClientRect();
Actions.openPopover(
<EmojiButtonPopover />,
{originRect: buttonRect, direction: 'up'}
)
}
render() {
return (
<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} />
</button>
);
}
}
EmojiButton.containerStyles = {
order: 2,
};
export default EmojiButton;