1 import { Component, linkEvent } from "inferno";
2 import { i18n } from "../../i18next";
3 import { EmojiMart } from "./emoji-mart";
4 import { Icon } from "./icon";
6 interface EmojiPickerProps {
7 onEmojiClick?(val: any): any;
10 interface EmojiPickerState {
14 export class EmojiPicker extends Component<
18 private emptyState: EmojiPickerState = {
21 state: EmojiPickerState;
22 constructor(props: any, context: any) {
23 super(props, context);
24 this.state = this.emptyState;
25 this.handleEmojiClick = this.handleEmojiClick.bind(this);
31 className="btn btn-sm text-muted"
32 data-tippy-content={i18n.t("emoji")}
33 aria-label={i18n.t("emoji")}
34 onClick={linkEvent(this,this.togglePicker)}
36 <Icon icon="smile" classes="icon-inline" />
39 {this.state.showPicker && (
41 <div className="emoji-picker-container">
42 <EmojiMart onEmojiClick={this.handleEmojiClick} pickerOptions={({})}></EmojiMart>
45 onClick={linkEvent(this,this.togglePicker)}
46 className="click-away-container"
54 togglePicker(i: EmojiPicker, e: any) {
56 i.setState({ showPicker: !i.state.showPicker });
59 handleEmojiClick(e: any) {
60 this.props.onEmojiClick?.(e);