Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
feat(ContractEditor): allow readOnly props
Browse files Browse the repository at this point in the history
Signed-off-by: irmerk <[email protected]>
  • Loading branch information
jolanglinais committed Dec 19, 2019
1 parent 97d56fb commit 24cf355
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"depcheck": "node ./scripts/depcheck.js"
},
"dependencies": {
"@accordproject/markdown-editor": "^0.8.5",
"@accordproject/markdown-editor": "^0.8.6",
"@accordproject/markdown-slate": "^0.9.4",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.7.0",
Expand Down Expand Up @@ -110,4 +110,4 @@
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
]
}
}
}
1 change: 1 addition & 0 deletions src/ContractEditor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ ReactDOM.render(<ContractEditor
- `value`: An `object` which is the initial contents of the editor.
- `lockText`: A `boolean` to lock all non variable text.
- `readOnly`: A `boolean` to lock all text and remove the formatting toolbar.
#### Functionality
Expand Down
2 changes: 2 additions & 0 deletions src/ContractEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const ContractEditor = React.forwardRef((props, ref) => {
onChange={props.onChange || contractProps.onChange}
plugins={plugins}
lockText={props.lockText}
readOnly={props.readOnly}
editorProps={{ ...props.editorProps, onUndoOrRedo: props.onUndoOrRedo }}
clausePluginProps={{
loadTemplateObject: props.loadTemplateObject,
Expand Down Expand Up @@ -107,6 +108,7 @@ ContractEditor.propTypes = {
WIDTH: PropTypes.string,
}),
lockText: PropTypes.bool,
readOnly: PropTypes.bool,
loadTemplateObject: PropTypes.func.isRequired,
pasteToContract: PropTypes.func.isRequired,
clauseMap: PropTypes.object,
Expand Down

0 comments on commit 24cf355

Please sign in to comment.