Skip to content
Snippets Groups Projects
Commit 450e11cf authored by chris's avatar chris
Browse files

essay readOnly

parent 1aaf93c3
No related branches found
No related tags found
1 merge request!374Add feedback
...@@ -70,7 +70,7 @@ const Editors = () => { ...@@ -70,7 +70,7 @@ const Editors = () => {
case 'ncbi': case 'ncbi':
return <NCBI />; return <NCBI />;
default: default:
return <Editoria />; return <HHMI />;
} }
}; };
......
...@@ -22,8 +22,8 @@ const BlockLevelTools = props => { ...@@ -22,8 +22,8 @@ const BlockLevelTools = props => {
groups.map(group => ( groups.map(group => (
<BlockElementGroup <BlockElementGroup
groupName={group.groupName} groupName={group.groupName}
key={group.groupName}
items={group.items} items={group.items}
key={group.groupName}
view={view} view={view}
/> />
))} ))}
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import React, { useEffect, useState, forwardRef } from 'react'; import React, { useEffect, useState, forwardRef } from 'react';
import { DOMSerializer } from 'prosemirror-model'; import { DOMSerializer } from 'prosemirror-model';
import { DefaultSchema } from 'wax-prosemirror-utilities'; import { DefaultSchema } from 'wax-prosemirror-utilities';
import WaxProvider from './WaxContext'; import WaxProvider from './WaxContext';
import PortalProvider from './PortalContext'; import PortalProvider from './PortalContext';
import Application from './Application'; import Application from './Application';
......
...@@ -11,7 +11,7 @@ import React, { ...@@ -11,7 +11,7 @@ import React, {
} from 'react'; } from 'react';
import applyDevTools from 'prosemirror-dev-tools'; import applyDevTools from 'prosemirror-dev-tools';
import { EditorState, TextSelection } from 'prosemirror-state'; import { EditorState } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view'; import { EditorView } from 'prosemirror-view';
import { trackedTransaction } from 'wax-prosemirror-services'; import { trackedTransaction } from 'wax-prosemirror-services';
import { WaxContext } from './WaxContext'; import { WaxContext } from './WaxContext';
......
...@@ -22,6 +22,8 @@ const EditorWrapper = styled.div` ...@@ -22,6 +22,8 @@ const EditorWrapper = styled.div`
display: flex; display: flex;
flex: 2 1 auto; flex: 2 1 auto;
justify-content: left; justify-content: left;
opacity: ${props => (props.editable ? 1 : 0.4)};
cursor: ${props => (props.editable ? 'default' : 'not-allowed')};
.ProseMirror { .ProseMirror {
white-space: break-spaces; white-space: break-spaces;
...@@ -118,7 +120,7 @@ const EssayAnswerComponent = ({ node, view, getPos }) => { ...@@ -118,7 +120,7 @@ const EssayAnswerComponent = ({ node, view, getPos }) => {
mount: editorRef.current, mount: editorRef.current,
}, },
{ {
editable: () => isEditable, editable: () => !isEditable,
state: EditorState.create({ state: EditorState.create({
doc: node, doc: node,
plugins: finalPlugins, plugins: finalPlugins,
...@@ -191,7 +193,7 @@ const EssayAnswerComponent = ({ node, view, getPos }) => { ...@@ -191,7 +193,7 @@ const EssayAnswerComponent = ({ node, view, getPos }) => {
}; };
return ( return (
<EditorWrapper> <EditorWrapper editable={!isEditable}>
<div ref={editorRef} /> <div ref={editorRef} />
</EditorWrapper> </EditorWrapper>
); );
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment