|
|
@ -148,12 +148,9 @@ class Editor extends React.Component {
|
|
|
|
upload() {
|
|
|
|
upload() {
|
|
|
|
this.setState({ uploading: true })
|
|
|
|
this.setState({ uploading: true })
|
|
|
|
this.getCarbonImage({ format: 'png' })
|
|
|
|
this.getCarbonImage({ format: 'png' })
|
|
|
|
.then(api.tweet)
|
|
|
|
.then(this.props.tweet)
|
|
|
|
|
|
|
|
.catch(console.error)
|
|
|
|
.then(() => this.setState({ uploading: false }))
|
|
|
|
.then(() => this.setState({ uploading: false }))
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
console.error(err)
|
|
|
|
|
|
|
|
this.setState({ uploading: false })
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onDrop([file]) {
|
|
|
|
onDrop([file]) {
|
|
|
@ -219,13 +216,15 @@ class Editor extends React.Component {
|
|
|
|
resetDefaultSettings={this.resetDefaultSettings}
|
|
|
|
resetDefaultSettings={this.resetDefaultSettings}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div className="buttons">
|
|
|
|
<div className="buttons">
|
|
|
|
<Button
|
|
|
|
{this.props.tweet && (
|
|
|
|
className="tweetButton"
|
|
|
|
<Button
|
|
|
|
onClick={this.upload}
|
|
|
|
className="tweetButton"
|
|
|
|
title={this.state.uploading ? 'Loading...' : 'Tweet Image'}
|
|
|
|
onClick={this.upload}
|
|
|
|
color="#57b5f9"
|
|
|
|
title={this.state.uploading ? 'Loading...' : 'Tweet Image'}
|
|
|
|
style={{ marginRight: '8px' }}
|
|
|
|
color="#57b5f9"
|
|
|
|
/>
|
|
|
|
style={{ marginRight: '8px' }}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
)}
|
|
|
|
<Dropdown {...saveButtonOptions} onChange={this.save} />
|
|
|
|
<Dropdown {...saveButtonOptions} onChange={this.save} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Toolbar>
|
|
|
|
</Toolbar>
|
|
|
|