From eea6f068b4dfd3ed7575c87a526bc263d1f44306 Mon Sep 17 00:00:00 2001 From: Lucas Duailibe Date: Thu, 12 Apr 2018 18:09:37 -0300 Subject: [PATCH] refactors --- website/package.json | 1 + website/pages/playground/index.html | 2 +- website/playground/Playground.js | 26 ++++++------------ website/playground/buttons.js | 1 + website/playground/sidebar/SidebarOptions.js | 29 ++++++++++++++++++++ website/playground/sidebar/inputs.js | 4 +-- website/yarn.lock | 4 +++ 7 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 website/playground/sidebar/SidebarOptions.js diff --git a/website/package.json b/website/package.json index f86045932..1c1b2b579 100644 --- a/website/package.json +++ b/website/package.json @@ -11,6 +11,7 @@ "clipboard": "2.0.0", "codemirror": "5.36.0", "codemirror-graphql": "0.6.12", + "lodash.groupby": "4.6.0", "lz-string": "1.4.4", "prop-types": "15.6.1", "react": "16.3.1", diff --git a/website/pages/playground/index.html b/website/pages/playground/index.html index 4e9055ac8..de384c924 100644 --- a/website/pages/playground/index.html +++ b/website/pages/playground/index.html @@ -71,7 +71,7 @@ -
+
diff --git a/website/playground/Playground.js b/website/playground/Playground.js index c75fd5038..e08dabdfb 100644 --- a/website/playground/Playground.js +++ b/website/playground/Playground.js @@ -10,6 +10,7 @@ import * as urlHash from "./urlHash"; import formatMarkdown from "./markdown"; import { Sidebar, SidebarCategory } from "./sidebar/components"; +import SidebarOptions from "./sidebar/SidebarOptions"; import Option from "./sidebar/options"; import { Checkbox } from "./sidebar/inputs"; @@ -97,24 +98,15 @@ class Playground extends React.Component { {editorState => ( -
+
- {categorizeOptions( - availableOptions, - (category, categoryOptions) => ( - - {categoryOptions.map(option => ( - - ) - )} +
- + )}
diff --git a/website/playground/buttons.js b/website/playground/buttons.js index a2cba42a1..eb8ae0eac 100644 --- a/website/playground/buttons.js +++ b/website/playground/buttons.js @@ -38,6 +38,7 @@ export class ClipboardButton extends React.Component { render() { const rest = Object.assign({}, this.props); delete rest.children; + delete rest.clipboardValue; return (