diff --git a/src/components/editor/plugins/fontfamily.js b/src/components/editor/plugins/fontfamily.js index 221ca9f2d..cd5b5a68f 100644 --- a/src/components/editor/plugins/fontfamily.js +++ b/src/components/editor/plugins/fontfamily.js @@ -68,14 +68,14 @@ const FontFamilyMark = ({ children, mark: { data } }: NodeProps) => ( const FontFamilyDropdown = ({ editor, classes }: ButtonProps) => { const [currentFont, setCurrentFont] = useState(3) + const handleChange = ({ target: { value: fontFamilyIndex } }) => { + setCurrentFont(fontFamilyIndex) + fontFamilyMarkStrategy(editor, fontFamilyIndex) + } + return ( - {FontFamilyList.map((font, index) => ( ( const FontSizeDropdown = ({ editor, classes }: ButtonProps) => { const [currentFontSize, setCurrentFontSize] = useState(2) + const handleChange = ({ target: { value: fontSizeIndex } }) => { + setCurrentFontSize(fontSizeIndex) + fontSizeMarkStrategy(editor, fontSizeIndex) + } + return ( - {FontSizeList.map((font, index) => ( { height, } + const handleAddImageClick = () => { + setImageModalOpen(false) + editor.command(insertImage, data) + } + return ( <> @@ -126,10 +131,7 @@ const ImageButtonUnconnected = ({ editor, classes }: ButtonProps) => {