This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch feat/1.2.1/ui
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 75ad9862ca771e6ca24e3b5b50e396fd2ea711ac
Author: shuai <[email protected]>
AuthorDate: Fri Nov 24 15:47:48 2023 +0800

    fix: change props name
---
 ui/src/components/Editor/ToolBars/image.tsx | 5 ++---
 ui/src/components/Editor/index.tsx          | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/ui/src/components/Editor/ToolBars/image.tsx 
b/ui/src/components/Editor/ToolBars/image.tsx
index abb8d3ac..48f1b039 100644
--- a/ui/src/components/Editor/ToolBars/image.tsx
+++ b/ui/src/components/Editor/ToolBars/image.tsx
@@ -29,8 +29,8 @@ import { IEditorContext } from '../types';
 import { uploadImage } from '@/services';
 
 let context: IEditorContext;
-const Image = ({ editorContext }) => {
-  const [editor, setEditor] = useState<Editor>(editorContext);
+const Image = ({ editorInstance }) => {
+  const [editor, setEditor] = useState<Editor>(editorInstance);
   const { t } = useTranslation('translation', { keyPrefix: 'editor' });
 
   const loadingText = `![${t('image.uploading')}...]()`;
@@ -197,7 +197,6 @@ const Image = ({ editorContext }) => {
     setImageName({ ...imageName, value: '' });
   };
   useEffect(() => {
-    console.log('editor img bar======', editor);
     editor?.on('dragenter', dragenter);
     editor?.on('dragover', dragover);
     editor?.on('drop', drop);
diff --git a/ui/src/components/Editor/index.tsx 
b/ui/src/components/Editor/index.tsx
index e70663cf..8d157a68 100644
--- a/ui/src/components/Editor/index.tsx
+++ b/ui/src/components/Editor/index.tsx
@@ -126,7 +126,7 @@ const MDEditor: ForwardRefRenderFunction<EditorRef, Props> 
= (
               <Code />
               <LinkItem />
               <BlockQuote />
-              <Image editorContext={editor} />
+              <Image editorInstance={editor} />
               <Table />
               <div className="toolbar-divider" />
               <OL />

Reply via email to