From 1ff70781e089ebd9a01807cda718c509deb94d52 Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Tue, 30 Apr 2019 15:22:50 +0200 Subject: [PATCH] Refactor nitpicks in app-js (#1052) * chore: nitpicks * remove console.logs --- packages/app-js/src/ActionButtons.tsx | 50 +++++++++++++-------------- packages/app-js/src/Playground.tsx | 15 ++++---- packages/ui-app/src/Editor/index.tsx | 2 +- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/packages/app-js/src/ActionButtons.tsx b/packages/app-js/src/ActionButtons.tsx index 161c37fc04..352e082401 100644 --- a/packages/app-js/src/ActionButtons.tsx +++ b/packages/app-js/src/ActionButtons.tsx @@ -13,10 +13,10 @@ import translate from './translate'; type Props = BareProps & I18nProps & { isCustomExample: boolean, isRunning: boolean, - saveSnippet: (snippetName: string) => void, generateLink: () => void, removeSnippet: () => void, runJs: () => void, + saveSnippet: (snippetName: string) => void, snippetName?: string, stopJs: () => void }; @@ -36,25 +36,25 @@ class ActionButtons extends React.PureComponent { render () { const { - props: { isCustomExample, isRunning,removeSnippet, runJs, stopJs, t }, - state: { isOpen, snippetName } + props: { isCustomExample, isRunning, removeSnippet, runJs, stopJs, t }, + state: { isOpen, shareText, snippetName } } = this; return (
- - } - wide={'very'} - /> + + } + wide='very' + /> { // FIXME: The event trigger on='hover' does not work together with the ui-app' //
diff --git a/packages/app-js/src/Playground.tsx b/packages/app-js/src/Playground.tsx index ea7a5a3daa..3d39da6461 100644 --- a/packages/app-js/src/Playground.tsx +++ b/packages/app-js/src/Playground.tsx @@ -69,6 +69,7 @@ class Playground extends React.PureComponent { constructor (props: Props) { super(props); + this.snippets.forEach(snippet => snippet.code = `${makeWrapper(this.props.isDevelopment)}${snippet.code}`); this.state = { @@ -122,10 +123,10 @@ class Playground extends React.PureComponent {
@@ -136,9 +137,9 @@ class Playground extends React.PureComponent { onEdit={this.onEdit} /> {