remove transparent row (#1084)

main
Michael Fix 4 years ago committed by GitHub
parent 94a5c71958
commit 361d170f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -351,7 +351,6 @@ class Carbon extends React.PureComponent {
onMouseUp={this.onMouseUp}
>
<SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper>
<div className="twitter-png-fix" />
</div>
{selectionNode &&
ReactDOM.createPortal(
@ -370,17 +369,6 @@ class Carbon extends React.PureComponent {
align-items: center;
overflow: hidden;
}
/* forces twitter to save images as png — https://github.com/carbon-app/carbon/issues/86 */
.twitter-png-fix {
/* TODO, remove?
* Twitter is currently converting everything to JPEGs anyways. Removing this
* would simplify the width/height calculations, as well as the includeTransparentRow option
*/
height: 0px;
width: 100%;
background: rgba(0, 0, 0, 0.01);
}
`}
</style>
</div>

@ -108,7 +108,6 @@ class Editor extends React.Component {
type,
squared = this.state.squaredImage,
exportSize = (EXPORT_SIZES_HASH[this.state.exportSize] || DEFAULT_EXPORT_SIZE).value,
includeTransparentRow = false,
} = { format: 'png' }
) => {
// if safari, get image from api
@ -155,9 +154,6 @@ class Editor extends React.Component {
if (className.includes('CodeMirror-cursors')) {
return false
}
if (className.includes('twitter-png-fix')) {
return includeTransparentRow
}
}
return true
},
@ -207,7 +203,7 @@ class Editor extends React.Component {
}
tweet = () => {
this.getCarbonImage({ format: 'png', includeTransparentRow: true }).then(
this.getCarbonImage({ format: 'png' }).then(
this.context.tweet.bind(null, this.state.code || DEFAULT_CODE)
)
}

@ -112,8 +112,7 @@ class Embed extends React.Component {
</div>
<style jsx global>
{`
.eliminateOnRender,
.twitter-png-fix {
.eliminateOnRender {
display: none;
}
`}

Loading…
Cancel
Save