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} onMouseUp={this.onMouseUp}
> >
<SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper> <SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper>
<div className="twitter-png-fix" />
</div> </div>
{selectionNode && {selectionNode &&
ReactDOM.createPortal( ReactDOM.createPortal(
@ -370,17 +369,6 @@ class Carbon extends React.PureComponent {
align-items: center; align-items: center;
overflow: hidden; 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> </style>
</div> </div>

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

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

Loading…
Cancel
Save