From aee7f20fdbc760154adab433ad9b549986db0554 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Tue, 18 Apr 2023 12:54:03 +0300 Subject: [PATCH] essay states --- .../EssayService/components/EssayPromptComponent.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wax-prosemirror-services/src/EssayService/components/EssayPromptComponent.js b/wax-prosemirror-services/src/EssayService/components/EssayPromptComponent.js index f74b6e14a..d2723be26 100644 --- a/wax-prosemirror-services/src/EssayService/components/EssayPromptComponent.js +++ b/wax-prosemirror-services/src/EssayService/components/EssayPromptComponent.js @@ -19,8 +19,7 @@ const EditorWrapper = styled.div` display: flex; flex: 2 1 auto; justify-content: left; - opacity: ${props => (props.editable ? 1 : 0.4)}; - cursor: ${props => (props.editable ? 'default' : 'not-allowed')}; + display: ${props => (props.testMode ? 'none' : 'block')}; .ProseMirror { white-space: break-spaces; @@ -55,6 +54,10 @@ const EssayPromptComponent = ({ node, view, getPos }) => { let essayPromptView; const questionId = node.attrs.id; + const isEditable = main.props.editable(editable => { + return editable; + }); + const customProps = main.props.customValues; const { testMode } = customProps; @@ -111,7 +114,7 @@ const EssayPromptComponent = ({ node, view, getPos }) => { }; finalPlugins = finalPlugins.concat([ - createPlaceholder('Type your essay prompt'), + createPlaceholder('Type your essay sample answer'), ...plugins, ]); @@ -121,7 +124,7 @@ const EssayPromptComponent = ({ node, view, getPos }) => { mount: editorRef.current, }, { - editable: () => testMode, + editable: () => isEditable, state: EditorState.create({ doc: node, plugins: finalPlugins, @@ -191,7 +194,7 @@ const EssayPromptComponent = ({ node, view, getPos }) => { }; return ( - <EditorWrapper editable={testMode}> + <EditorWrapper testMode={testMode}> <div ref={editorRef} /> </EditorWrapper> ); -- GitLab