From 3187b6777a1425f8ff63647ecea67b6f43cf2442 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Mon, 25 Feb 2019 11:16:50 -0600 Subject: [PATCH] make titleBar uncontrolled --- components/Carbon.js | 2 -- components/Editor.js | 6 +----- components/WindowControls.js | 10 ++-------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/components/Carbon.js b/components/Carbon.js index e55dbed..b4900e1 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -94,9 +94,7 @@ class Carbon extends React.PureComponent {
{config.windowControls ? ( diff --git a/components/Editor.js b/components/Editor.js index bb9e181..d84a20d 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -104,7 +104,6 @@ class Editor extends React.Component { updateCode = code => this.updateState({ code }) updateAspectRatio = aspectRatio => this.updateState({ aspectRatio }) - updateTitleBar = titleBar => this.updateState({ titleBar }) async getCarbonImage( { @@ -285,12 +284,11 @@ class Editor extends React.Component { backgroundImage, backgroundMode, aspectRatio, - titleBar, code, exportSize } = this.state - const config = omit(this.state, ['code', 'aspectRatio', 'titleBar']) + const config = omit(this.state, ['code', 'aspectRatio']) return ( <> @@ -347,8 +345,6 @@ class Editor extends React.Component { config={this.state} onChange={this.updateCode} onAspectRatioChange={this.updateAspectRatio} - titleBar={titleBar} - updateTitleBar={this.updateTitleBar} loading={this.state.loading} > {code != null ? code : DEFAULT_CODE} diff --git a/components/WindowControls.js b/components/WindowControls.js index fd9551c..3aac179 100644 --- a/components/WindowControls.js +++ b/components/WindowControls.js @@ -36,17 +36,11 @@ const CopyButton = React.memo(function CopyButton({ text }) { ) }) -export default ({ titleBar, theme, handleTitleBarChange, copyable, code }) => ( +export default ({ theme, copyable, code }) => (
{theme === 'bw' ? : }
- handleTitleBarChange(e.target.value)} - /> +
{copyable && (