main
Mike Fix 8 years ago
parent 94bed49f07
commit dcc6317a7e

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

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

Loading…
Cancel
Save