bug fix for /embed/<gist>

main
Mike Fix 6 years ago
parent 297c385fbb
commit 3540124819

@ -12,7 +12,8 @@ import {
LANGUAGE_MODE_HASH, LANGUAGE_MODE_HASH,
LANGUAGE_NAME_HASH, LANGUAGE_NAME_HASH,
LANGUAGE_MIME_HASH, LANGUAGE_MIME_HASH,
DEFAULT_SETTINGS DEFAULT_SETTINGS,
THEMES_HASH
} from '../lib/constants' } from '../lib/constants'
const Watermark = dynamic(() => import('./svg/Watermark'), { const Watermark = dynamic(() => import('./svg/Watermark'), {
@ -92,6 +93,8 @@ class Carbon extends React.PureComponent {
(this.props.config.backgroundImage && this.props.config.backgroundImageSelection) || (this.props.config.backgroundImage && this.props.config.backgroundImageSelection) ||
this.props.config.backgroundImage this.props.config.backgroundImage
const themeConfig = THEMES_HASH[config.theme]
const content = ( const content = (
<div className="container"> <div className="container">
{config.windowControls ? ( {config.windowControls ? (
@ -99,7 +102,7 @@ class Carbon extends React.PureComponent {
theme={config.windowTheme} theme={config.windowTheme}
code={this.props.children} code={this.props.children}
copyable={this.props.copyable} copyable={this.props.copyable}
light={this.props.theme.light} light={themeConfig.light}
/> />
) : null} ) : null}
<CodeMirror <CodeMirror
@ -108,7 +111,7 @@ class Carbon extends React.PureComponent {
value={this.props.children} value={this.props.children}
options={options} options={options}
/> />
{config.watermark && <Watermark light={this.props.theme.light} />} {config.watermark && <Watermark light={themeConfig.light} />}
<div className="container-bg"> <div className="container-bg">
<div className="white eliminateOnRender" /> <div className="white eliminateOnRender" />
<div className="alpha eliminateOnRender" /> <div className="alpha eliminateOnRender" />

@ -370,7 +370,6 @@ class Editor extends React.Component {
key={language} key={language}
ref={this.carbonNode} ref={this.carbonNode}
config={this.state} config={this.state}
theme={theme}
onChange={this.updateCode} onChange={this.updateCode}
loading={this.state.loading} loading={this.state.loading}
> >

Loading…
Cancel
Save