From 3694da35972ebcec217e400a16ed5354238916d6 Mon Sep 17 00:00:00 2001 From: Jerome Simeon Date: Thu, 16 May 2019 15:07:27 -0400 Subject: [PATCH] (feature) props to say whether to show Edit button Signed-off-by: Jerome Simeon --- src/index.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 1ffac05..0ce4940 100644 --- a/src/index.js +++ b/src/index.js @@ -513,13 +513,14 @@ function MarkdownEditor(props) { return (
- - - - - {card} - -
+ { props.showEditButton ? + + + : null } + + {card} + + ); } @@ -550,6 +551,11 @@ MarkdownEditor.propTypes = { */ lockText: PropTypes.bool, + /** + * If true then show the edit button. + */ + showEditButton: PropTypes.bool, + /** * An array of plugins to extend the functionality of the editor */ @@ -568,5 +574,11 @@ MarkdownEditor.propTypes = { schema: PropTypes.object.isRequired, })), }; +/** + * The default property values for this component + */ +MarkdownEditor.defaultProps = { + showEditButton: true, +} export { MarkdownEditor };