use css composition instead of props

main
Mike Fix 5 years ago
parent c967318194
commit 1ded53f6bb

@ -153,8 +153,8 @@ class Carbon extends React.PureComponent {
/> />
{config.watermark && <Watermark light={light} />} {config.watermark && <Watermark light={light} />}
<div className="container-bg"> <div className="container-bg">
{!this.props.embed && <div className="white eliminateOnRender" />} <div className="white eliminateOnRender" />
{!this.props.embed && <div className="alpha eliminateOnRender" />} <div className="alpha eliminateOnRender" />
<div className="bg" /> <div className="bg" />
</div> </div>
<style jsx> <style jsx>
@ -272,7 +272,7 @@ class Carbon extends React.PureComponent {
<div className="section"> <div className="section">
<div className="export-container" ref={this.props.innerRef} id="export-container"> <div className="export-container" ref={this.props.innerRef} id="export-container">
<SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper> <SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper>
{this.props.embed && <div className="twitter-png-fix" />} <div className="twitter-png-fix" />
</div> </div>
<style jsx> <style jsx>
{` {`

@ -111,11 +111,18 @@ class Embed extends React.Component {
readOnly={this.state.readOnly} readOnly={this.state.readOnly}
copyable={this.state.copyable} copyable={this.state.copyable}
onChange={this.updateCode} onChange={this.updateCode}
embed={true}
> >
{this.state.code} {this.state.code}
</Carbon> </Carbon>
)} )}
<style jsx global>
{`
.eliminateOnRender,
.twitter-png-fix {
display: none;
}
`}
</style>
</Page> </Page>
) )
} }

Loading…
Cancel
Save