chore: remove fullscreen button

This commit is contained in:
Steven
2023-09-10 10:48:08 +08:00
parent 2e79fe12e2
commit 7ec5d07cb8
3 changed files with 8 additions and 62 deletions

View File

@ -18,14 +18,13 @@ interface Props {
className: string;
initialContent: string;
placeholder: string;
fullscreen: boolean;
tools?: ReactNode;
onContentChange: (content: string) => void;
onPaste: (event: React.ClipboardEvent) => void;
}
const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef<EditorRefActions>) {
const { className, initialContent, placeholder, fullscreen, onPaste, onContentChange: handleContentChangeCallback } = props;
const { className, initialContent, placeholder, onPaste, onContentChange: handleContentChangeCallback } = props;
const editorRef = useRef<HTMLTextAreaElement>(null);
useEffect(() => {
@ -36,10 +35,10 @@ const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef<
}, []);
useEffect(() => {
if (editorRef.current && !fullscreen) {
if (editorRef.current) {
updateEditorHeight();
}
}, [editorRef.current?.value, fullscreen]);
}, [editorRef.current?.value]);
const updateEditorHeight = () => {
if (editorRef.current) {