From 1380bcddb6b64be20713f79f61b93af25e603cad Mon Sep 17 00:00:00 2001 From: briandennis Date: Sat, 16 Sep 2017 12:04:13 -0500 Subject: [PATCH] make dragged files, gist work again and be editable --- pages/editor.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/editor.js b/pages/editor.js index d90b52b..746872c 100644 --- a/pages/editor.js +++ b/pages/editor.js @@ -24,8 +24,8 @@ class Editor extends React.Component { return {} } - constructor() { - super() + constructor(props) { + super(props) this.state = { background: '#ABB8C3', theme: THEMES[0].id, @@ -35,7 +35,7 @@ class Editor extends React.Component { paddingVertical: '48px', paddingHorizontal: '32px', uploading: false, - code: DEFAULT_CODE + code: props.content || DEFAULT_CODE } this.save = this.save.bind(this) @@ -87,7 +87,7 @@ class Editor extends React.Component { return ( this.setState({ droppedContent })} + onDrop={droppedContent => this.setState({ code: droppedContent })} >
- {this.state.droppedContent || this.props.content || this.state.code} + {this.state.code}