lemmy-ui/src/shared/components/common/emoji-mart.tsx
Alec Armbruster 043b522ff1
utils.ts organization, round two (#1427)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update src/shared/utils/app/convert-comment-sort-type.ts

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>

* prettier pass

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
2023-06-21 18:28:24 -04:00

30 lines
706 B
TypeScript

import { Component } from "inferno";
import { getEmojiMart } from "../../markdown";
interface EmojiMartProps {
onEmojiClick?(val: any): any;
pickerOptions: any;
}
export class EmojiMart extends Component<EmojiMartProps> {
constructor(props: any, context: any) {
super(props, context);
this.handleEmojiClick = this.handleEmojiClick.bind(this);
}
componentDidMount() {
const div: any = document.getElementById("emoji-picker");
if (div) {
div.appendChild(
getEmojiMart(this.handleEmojiClick, this.props.pickerOptions)
);
}
}
render() {
return <div id="emoji-picker"></div>;
}
handleEmojiClick(e: any) {
this.props.onEmojiClick?.(e);
}
}