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

Commit

Permalink
(feature) props to say whether to show Edit button
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed May 16, 2019
1 parent 715e9c1 commit 3694da3
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,14 @@ function MarkdownEditor(props) {

return (
<div>
<Segment raised>
<Checkbox toggle label='Edit' onChange={toggleShowSlate} checked={props.markdownMode ? !showSlate : showSlate} />
</Segment>
<Card.Group>
{card}
</Card.Group>
</div>
{ props.showEditButton ?
<Segment raised>
<Checkbox toggle label='Edit' onChange={toggleShowSlate} checked={props.markdownMode ? !showSlate : showSlate} />
</Segment> : null }
<Card.Group>
{card}
</Card.Group>
</div>
);
}

Expand Down Expand Up @@ -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
*/
Expand All @@ -568,5 +574,11 @@ MarkdownEditor.propTypes = {
schema: PropTypes.object.isRequired,
})),
};
/**
* The default property values for this component
*/
MarkdownEditor.defaultProps = {
showEditButton: true,
}

export { MarkdownEditor };

0 comments on commit 3694da3

Please sign in to comment.