Use Event for emoji
This commit is contained in:
parent
75be1f9954
commit
7fcc65a3fe
5 changed files with 63 additions and 19 deletions
|
@ -22,8 +22,8 @@ import { PlainTextComposer } from './components/PlainTextComposer';
|
|||
import { ComposerFunctions } from './types';
|
||||
import { E2EStatus } from '../../../../utils/ShieldUtils';
|
||||
import E2EIcon from '../E2EIcon';
|
||||
import { EmojiButton } from '../EmojiButton';
|
||||
import { AboveLeftOf } from '../../../structures/ContextMenu';
|
||||
import { Emoji } from './components/Emoji';
|
||||
|
||||
interface ContentProps {
|
||||
disabled?: boolean;
|
||||
|
@ -58,15 +58,8 @@ export function SendWysiwygComposer(
|
|||
return <Composer
|
||||
className="mx_SendWysiwygComposer"
|
||||
leftComponent={e2eStatus && <E2EIcon status={e2eStatus} />}
|
||||
// TODO add emoji support
|
||||
rightComponent={(composerFunctions, selectPreviousSelection) =>
|
||||
<EmojiButton menuPosition={menuPosition}
|
||||
addEmoji={(unicode) => {
|
||||
selectPreviousSelection();
|
||||
setTimeout(() => composerFunctions.insertText(unicode), 100);
|
||||
return true;
|
||||
}}
|
||||
/>}
|
||||
rightComponent={(selectPreviousSelection) =>
|
||||
<Emoji menuPosition={menuPosition} selectPreviousSelection={selectPreviousSelection} />}
|
||||
{...props}
|
||||
>
|
||||
{ (ref, composerFunctions) => (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue