mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-14 20:11:22 +00:00
Define type
This commit is contained in:
parent
dded49145a
commit
4c8c90a579
@ -1,5 +1,5 @@
|
|||||||
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
import { EditorProvider, useCurrentEditor } from '@tiptap/react';
|
import { Editor, EditorProvider, useCurrentEditor } from '@tiptap/react';
|
||||||
import StarterKit from '@tiptap/starter-kit';
|
import StarterKit from '@tiptap/starter-kit';
|
||||||
import { Color } from '@tiptap/extension-color';
|
import { Color } from '@tiptap/extension-color';
|
||||||
import ListItem from '@tiptap/extension-list-item';
|
import ListItem from '@tiptap/extension-list-item';
|
||||||
@ -373,11 +373,26 @@ const extensions = [
|
|||||||
|
|
||||||
const content = ``;
|
const content = ``;
|
||||||
|
|
||||||
export default ({
|
type TiptapProps = {
|
||||||
|
setEditorRef: (editorInstance: Editor | null) => void;
|
||||||
|
onEnter: () => void | Promise<void>;
|
||||||
|
disableEnter?: boolean;
|
||||||
|
isChat?: boolean;
|
||||||
|
maxHeightOffset?: number;
|
||||||
|
overrideMobile?: boolean;
|
||||||
|
customEditorHeight?: number | null;
|
||||||
|
setIsFocusedParent: React.Dispatch<React.SetStateAction<boolean>>;
|
||||||
|
isFocusedParent: boolean;
|
||||||
|
membersWithNames: unknown[];
|
||||||
|
enableMentions?: boolean;
|
||||||
|
insertImage: (image: any) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Tiptap = ({
|
||||||
setEditorRef,
|
setEditorRef,
|
||||||
onEnter,
|
onEnter,
|
||||||
disableEnter,
|
disableEnter = false,
|
||||||
isChat,
|
isChat = false,
|
||||||
maxHeightOffset,
|
maxHeightOffset,
|
||||||
setIsFocusedParent,
|
setIsFocusedParent,
|
||||||
isFocusedParent,
|
isFocusedParent,
|
||||||
@ -386,7 +401,7 @@ export default ({
|
|||||||
membersWithNames,
|
membersWithNames,
|
||||||
enableMentions,
|
enableMentions,
|
||||||
insertImage,
|
insertImage,
|
||||||
}) => {
|
}: TiptapProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [isDisabledEditorEnter, setIsDisabledEditorEnter] = useAtom(
|
const [isDisabledEditorEnter, setIsDisabledEditorEnter] = useAtom(
|
||||||
isDisabledEditorEnterAtom
|
isDisabledEditorEnterAtom
|
||||||
@ -613,3 +628,5 @@ export default ({
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Tiptap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user