mirror of
https://github.com/usememos/memos.git
synced 2025-01-01 10:01:54 +08:00
chore: hide the searchbar of emoji picker (#222)
chore: hide emoji picker searchbar
This commit is contained in:
parent
e7db587a9e
commit
f4d0e8c948
2 changed files with 8 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
import { forwardRef, useEffect } from "react";
|
||||
import Picker, { IEmojiPickerProps } from "emoji-picker-react";
|
||||
|
||||
export type EmojiPickerElement = HTMLDivElement;
|
||||
type EmojiPickerElement = HTMLDivElement;
|
||||
|
||||
interface Props {
|
||||
isShowEmojiPicker: boolean;
|
||||
|
@ -31,7 +31,7 @@ export const EmojiPicker = forwardRef<EmojiPickerElement, Props>((props: Props,
|
|||
|
||||
return (
|
||||
<div className="emoji-picker" ref={ref}>
|
||||
<Picker onEmojiClick={onEmojiClick} />
|
||||
<Picker onEmojiClick={onEmojiClick} disableSearchBar />
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { IEmojiData } from "emoji-picker-react";
|
||||
import { UNKNOWN_ID } from "../helpers/consts";
|
||||
import { editorStateService, locationService, memoService, resourceService } from "../services";
|
||||
import useI18n from "../hooks/useI18n";
|
||||
|
@ -11,9 +12,9 @@ import EmojiPicker from "./Editor/EmojiPicker";
|
|||
import "../less/memo-editor.less";
|
||||
|
||||
interface State {
|
||||
isUploadingResource: boolean;
|
||||
fullscreen: boolean;
|
||||
isShowEmojiPicker: boolean;
|
||||
fullscreen: boolean;
|
||||
isUploadingResource: boolean;
|
||||
}
|
||||
|
||||
const MemoEditor = () => {
|
||||
|
@ -254,11 +255,12 @@ const MemoEditor = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const handleEmojiClick = (event: any, emojiObject: any) => {
|
||||
const handleEmojiClick = (_: any, emojiObject: IEmojiData) => {
|
||||
if (!editorRef.current) {
|
||||
return;
|
||||
}
|
||||
editorRef.current?.insertText(`${emojiObject.emoji}`);
|
||||
|
||||
editorRef.current.insertText(`${emojiObject.emoji}`);
|
||||
handleChangeIsShowEmojiPicker(false);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue