import { Component, linkEvent } from "inferno"; import { i18n } from "../../i18next"; import { EmojiMart } from "./emoji-mart"; import { Icon } from "./icon"; interface EmojiPickerProps { onEmojiClick?(val: any): any; } interface EmojiPickerState { showPicker: boolean; } export class EmojiPicker extends Component { private emptyState: EmojiPickerState = { showPicker: false, }; state: EmojiPickerState; constructor(props: any, context: any) { super(props, context); this.state = this.emptyState; this.handleEmojiClick = this.handleEmojiClick.bind(this); } render() { return ( {this.state.showPicker && ( <>
)} ); } togglePicker(i: EmojiPicker, e: any) { e.preventDefault(); i.setState({ showPicker: !i.state.showPicker }); } handleEmojiClick(e: any) { this.props.onEmojiClick?.(e); } }