From f4d0e8c948544188c0ba5ba74d4a331cf40ec342 Mon Sep 17 00:00:00 2001 From: boojack Date: Sat, 17 Sep 2022 09:23:53 +0800 Subject: [PATCH] chore: hide the searchbar of emoji picker (#222) chore: hide emoji picker searchbar --- web/src/components/Editor/EmojiPicker.tsx | 4 ++-- web/src/components/MemoEditor.tsx | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/src/components/Editor/EmojiPicker.tsx b/web/src/components/Editor/EmojiPicker.tsx index efa2c9f6..7fdd9728 100644 --- a/web/src/components/Editor/EmojiPicker.tsx +++ b/web/src/components/Editor/EmojiPicker.tsx @@ -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((props: Props, return (
- +
); }); diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsx index 8cd9b65d..7737ae0f 100644 --- a/web/src/components/MemoEditor.tsx +++ b/web/src/components/MemoEditor.tsx @@ -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); };