|
|
@ -4,6 +4,7 @@ import { DragDropContext } from 'react-dnd'
|
|
|
|
import Axios from 'axios'
|
|
|
|
import Axios from 'axios'
|
|
|
|
import domtoimage from 'dom-to-image'
|
|
|
|
import domtoimage from 'dom-to-image'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import ReadFileDropContainer from '../components/ReadFileDropContainer'
|
|
|
|
import Logo from '../components/svg/Logo'
|
|
|
|
import Logo from '../components/svg/Logo'
|
|
|
|
import Meta from '../components/Meta'
|
|
|
|
import Meta from '../components/Meta'
|
|
|
|
import Toolbar from '../components/Toolbar'
|
|
|
|
import Toolbar from '../components/Toolbar'
|
|
|
@ -67,6 +68,12 @@ class Index extends React.Component {
|
|
|
|
<h1>The easiest way to create images from source code. Start typing, or drag a file into the text area to get started.</h1>
|
|
|
|
<h1>The easiest way to create images from source code. Start typing, or drag a file into the text area to get started.</h1>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<ReadFileDropContainer
|
|
|
|
|
|
|
|
onDrop={(droppedContent) => {
|
|
|
|
|
|
|
|
console.log(droppedContent)
|
|
|
|
|
|
|
|
this.setState({ droppedContent })
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
<div id="editor">
|
|
|
|
<div id="editor">
|
|
|
|
<Toolbar
|
|
|
|
<Toolbar
|
|
|
|
save={this.save}
|
|
|
|
save={this.save}
|
|
|
@ -76,11 +83,13 @@ class Index extends React.Component {
|
|
|
|
onLanguageChange={language => this.setState({ language })}
|
|
|
|
onLanguageChange={language => this.setState({ language })}
|
|
|
|
onSettingsChange={(key, value) => this.setState({ [key]: value })}
|
|
|
|
onSettingsChange={(key, value) => this.setState({ [key]: value })}
|
|
|
|
bg={this.state.background}
|
|
|
|
bg={this.state.background}
|
|
|
|
|
|
|
|
enabled={this.state}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<CodeImage config={this.state}>
|
|
|
|
<CodeImage config={this.state}>
|
|
|
|
{this.droppedContent || this.props.content || DEFAULT_CODE}
|
|
|
|
{this.state.droppedContent || this.props.content || DEFAULT_CODE}
|
|
|
|
</CodeImage>
|
|
|
|
</CodeImage>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</ReadFileDropContainer>
|
|
|
|
<div className="footer">
|
|
|
|
<div className="footer">
|
|
|
|
<span>a project by <a href="https://twitter.com/dawn_labs">@dawn_labs ¬</a></span>
|
|
|
|
<span>a project by <a href="https://twitter.com/dawn_labs">@dawn_labs ¬</a></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|