From 3540124819a20f15adaa856a6cd5cf21690c5d0c Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Mon, 15 Apr 2019 09:57:29 -0700 Subject: [PATCH] bug fix for /embed/ --- components/Carbon.js | 9 ++++++--- components/Editor.js | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/Carbon.js b/components/Carbon.js index a2cae3c..1b37df9 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -12,7 +12,8 @@ import { LANGUAGE_MODE_HASH, LANGUAGE_NAME_HASH, LANGUAGE_MIME_HASH, - DEFAULT_SETTINGS + DEFAULT_SETTINGS, + THEMES_HASH } from '../lib/constants' 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 + const themeConfig = THEMES_HASH[config.theme] + const content = (
{config.windowControls ? ( @@ -99,7 +102,7 @@ class Carbon extends React.PureComponent { theme={config.windowTheme} code={this.props.children} copyable={this.props.copyable} - light={this.props.theme.light} + light={themeConfig.light} /> ) : null} - {config.watermark && } + {config.watermark && }
diff --git a/components/Editor.js b/components/Editor.js index d98749f..f150c30 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -370,7 +370,6 @@ class Editor extends React.Component { key={language} ref={this.carbonNode} config={this.state} - theme={theme} onChange={this.updateCode} loading={this.state.loading} >