make dragged files, gist work again and be editable

main
briandennis 7 years ago
parent d8f2735437
commit 1380bcddb6

@ -24,8 +24,8 @@ class Editor extends React.Component {
return {} return {}
} }
constructor() { constructor(props) {
super() super(props)
this.state = { this.state = {
background: '#ABB8C3', background: '#ABB8C3',
theme: THEMES[0].id, theme: THEMES[0].id,
@ -35,7 +35,7 @@ class Editor extends React.Component {
paddingVertical: '48px', paddingVertical: '48px',
paddingHorizontal: '32px', paddingHorizontal: '32px',
uploading: false, uploading: false,
code: DEFAULT_CODE code: props.content || DEFAULT_CODE
} }
this.save = this.save.bind(this) this.save = this.save.bind(this)
@ -87,7 +87,7 @@ class Editor extends React.Component {
return ( return (
<Page enableHeroText> <Page enableHeroText>
<ReadFileDropContainer <ReadFileDropContainer
onDrop={droppedContent => this.setState({ droppedContent })} onDrop={droppedContent => this.setState({ code: droppedContent })}
> >
<div id="editor"> <div id="editor">
<Toolbar <Toolbar
@ -102,7 +102,7 @@ class Editor extends React.Component {
enabled={this.state} enabled={this.state}
/> />
<Carbon config={this.state} updateCode={this.updateCode}> <Carbon config={this.state} updateCode={this.updateCode}>
{this.state.droppedContent || this.props.content || this.state.code} {this.state.code}
</Carbon> </Carbon>
</div> </div>
</ReadFileDropContainer> </ReadFileDropContainer>

Loading…
Cancel
Save