main
Mike Fix 8 years ago
parent 94bed49f07
commit dcc6317a7e

@ -15,10 +15,11 @@ class ColorPicker extends React.Component {
} }
handleClickOutside() { handleClickOutside() {
this.setState({ isVisible: false }); this.setState({ isVisible: false })
} }
handlePickColor(color) { handlePickColor(color) {
this.setState({ isVisible: false })
this.props.onChange(color.hex) this.props.onChange(color.hex)
} }

@ -30,10 +30,12 @@ class Index extends React.Component {
} }
save () { save () {
// domtoimage.toPng(document.getElementById('container'))
domtoimage.toJpeg(document.getElementById('container')) domtoimage.toJpeg(document.getElementById('container'))
.then((dataUrl) => { .then((dataUrl) => {
const link = document.createElement('a') const link = document.createElement('a')
link.download = 'my-image-name.jpeg' // link.download = 'snippet.png'
link.download = 'snippet.jpeg'
link.href = dataUrl link.href = dataUrl
link.click() link.click()
}) })

Loading…
Cancel
Save