Only rendering the emoji picker when it's needed
If not done so the whole channel select render will take an eternity
This commit is contained in:
parent
4d9df41c35
commit
b17fb5dea8
1 changed files with 17 additions and 14 deletions
|
@ -59,21 +59,24 @@ const EmojiButton = (props: { events: Registry<ChatBoxEvents> }) => {
|
||||||
<img alt={""} src={"img/smiley-smile.svg"} />
|
<img alt={""} src={"img/smiley-smile.svg"} />
|
||||||
</div>
|
</div>
|
||||||
<div className={cssStyle.picker} style={{ display: shown ? undefined : "none" }}>
|
<div className={cssStyle.picker} style={{ display: shown ? undefined : "none" }}>
|
||||||
<Picker
|
{!shown ? undefined :
|
||||||
set={"twitter"}
|
<Picker
|
||||||
theme={"light"}
|
key={"picker"}
|
||||||
showPreview={true}
|
set={"twitter"}
|
||||||
title={""}
|
theme={"light"}
|
||||||
showSkinTones={true}
|
showPreview={true}
|
||||||
useButton={false}
|
title={""}
|
||||||
native={false}
|
showSkinTones={true}
|
||||||
|
useButton={false}
|
||||||
|
native={false}
|
||||||
|
|
||||||
onSelect={(emoji: any) => {
|
onSelect={(emoji: any) => {
|
||||||
if(enabled) {
|
if(enabled) {
|
||||||
props.events.fire("action_insert_text", { text: emoji.native, focus: true });
|
props.events.fire("action_insert_text", { text: emoji.native, focus: true });
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue