diff --git a/components/Editor.js b/components/Editor.js index 8f785c0..bbf6122 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -122,7 +122,8 @@ class Editor extends React.Component { format, type, squared = this.state.squaredImage, - exportSize = (EXPORT_SIZES_HASH[this.state.exportSize] || DEFAULT_EXPORT_SIZE).value + exportSize = (EXPORT_SIZES_HASH[this.state.exportSize] || DEFAULT_EXPORT_SIZE).value, + includeTransparentRow = false } = { format: 'png' } ) { // if safari, get image from api @@ -167,7 +168,12 @@ class Editor extends React.Component { }, filter: n => { if (n.className) { - return String(n.className).indexOf('eliminateOnRender') < 0 + if (String(n.className).indexOf('eliminateOnRender') > -1) { + return false + } + if (String(n.className).indexOf('twitter-png-fix') > -1) { + return includeTransparentRow + } } return true }, @@ -245,7 +251,7 @@ class Editor extends React.Component { } upload() { - this.getCarbonImage({ format: 'png' }).then( + this.getCarbonImage({ format: 'png', includeTransparentRow: true }).then( this.context.tweet.bind(null, this.state.code || DEFAULT_CODE) ) }