Permalink
Browse files

added code block

  • Loading branch information...
juliankrispel committed Jun 16, 2017
1 parent 49a546b commit 534d124b240a58a04bd5b2a6029554bc4080b50a
Showing with 21 additions and 0 deletions.
  1. +5 −0 src/App.js
  2. +16 −0 src/index.css
View
@@ -28,10 +28,15 @@ class App extends Component {
this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, 'UNDERLINE'));
}
onToggleCode = () => {
this.onChange(RichUtils.toggleCode(this.state.editorState));
}
render() {
return (
<div>
<button onClick={this.onUnderlineClick}>Underline</button>
<button onClick={this.onToggleCode}>Code Block</button>
<Editor
editorState={this.state.editorState}
handleKeyCommand={this.handleKeyCommand}
View
@@ -25,3 +25,19 @@ button{
button:hover{
background: #888;
}
pre{
border: 1px solid #ccc;
background: #f0f0f0;
border-radius: .2em;
padding: .5em;
margin: 0;
}
pre > pre{
background: none;
border: none;
padding: 0;
}

0 comments on commit 534d124

Please sign in to comment.