diff --git a/packages/graphql-playground-react/src/components/Playground/DragBar.tsx b/packages/graphql-playground-react/src/components/Playground/DragBar.tsx deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/graphql-playground-react/src/components/Playground/ExecuteButtonOperation.tsx b/packages/graphql-playground-react/src/components/Playground/ExecuteButtonOperation.tsx index 4cf46eb58..2d0b35710 100644 --- a/packages/graphql-playground-react/src/components/Playground/ExecuteButtonOperation.tsx +++ b/packages/graphql-playground-react/src/components/Playground/ExecuteButtonOperation.tsx @@ -8,31 +8,31 @@ export interface Props { highlight: any } -export default class ExecuteButtonOperation extends React.Component { +class ExecuteButtonOperation extends React.PureComponent { render() { - const { operation, highlight } = this.props return (
  • - {operation.name ? operation.name.value : ''} + {this.props.operation.name + ? this.props.operation.name.value + : ''}
  • ) } - - private handleMouseOver = () => { + private onMouseOver = () => { this.props.onMouseOver(this.props.operation) } - private handleMouseOut = () => { - this.props.onMouseOut() - } - - private handleMouseUp = () => { + private onMouseUp = () => { this.props.onMouseUp(this.props.operation) } } + +export default ExecuteButtonOperation diff --git a/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx b/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx index 47ac7b33b..dca0fc1bf 100644 --- a/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx +++ b/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx @@ -367,21 +367,6 @@ export class GraphQLEditor extends React.PureComponent< } render() { - const queryWrapStyle = { - WebkitFlex: this.state.editorFlex, - flex: this.state.editorFlex, - } - - const variableOpen = this.state.variableEditorOpen - const variableStyle = { - height: variableOpen ? this.state.variableEditorHeight : null, - } - - const tracingOpen = this.state.responseTracingOpen - const tracingStyle = { - height: tracingOpen ? this.state.responseTracingHeight : null, - } - return (
    -
    +
    Listening …
    )} -
    +
    Tracing diff --git a/packages/graphql-playground-react/src/components/Playground/Results.tsx b/packages/graphql-playground-react/src/components/Playground/Results.tsx index 58517d102..04a3f3023 100644 --- a/packages/graphql-playground-react/src/components/Playground/Results.tsx +++ b/packages/graphql-playground-react/src/components/Playground/Results.tsx @@ -11,77 +11,75 @@ export interface Props { responses: Response[] } -export default class Results extends React.Component { - render() { - const { disableResize } = this.props - const isSubscription = this.props.responses.length > 1 - return ( -
    - - {this.props.responses.map(response => ( -
    - {this.props.responses.length > 1 && - response.time && ( -
    -
    - {ageOfDate(response.time)} -
    -
    - )} -
    - + .result-viewer-wrapper { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: auto; + } + .isSubscription .result-viewer-wrapper { + position: relative; + } + `} + {responses.map(response => ( +
    + {responses.length > 1 && + response.time && ( +
    +
    + {ageOfDate(response.time)} +
    -
    - ))} + )} +
    + +
    - ) - } -} + ))} +
    +) + +export default Results diff --git a/packages/graphql-playground-react/src/components/Spinner.tsx b/packages/graphql-playground-react/src/components/Spinner.tsx index edbc6c2b0..147e286f4 100644 --- a/packages/graphql-playground-react/src/components/Spinner.tsx +++ b/packages/graphql-playground-react/src/components/Spinner.tsx @@ -1,15 +1,11 @@ import * as React from 'react' import { keyframes, styled } from '../styled' -const Spinner = () => { - return ( - - - - ) -} - -export default Spinner +const Spinner = () => ( + + + +) const rotation = keyframes` from { @@ -45,3 +41,5 @@ const SpinnerNode = styled.div` border-right: 6px solid rgba(150, 150, 150, 0.15); border-top: 6px solid rgba(150, 150, 150, 0.8); ` + +export default Spinner diff --git a/packages/graphql-playground-react/src/components/Toggle.tsx b/packages/graphql-playground-react/src/components/Toggle.tsx index 6122170c4..bde052f31 100644 --- a/packages/graphql-playground-react/src/components/Toggle.tsx +++ b/packages/graphql-playground-react/src/components/Toggle.tsx @@ -7,26 +7,24 @@ export interface ToggleProps { activeChoice: string } -export default function Toggle({ +const Toggle: React.SFC = ({ choices, onChange, activeChoice, -}: ToggleProps) { - return ( - - {choices.map((choice, i) => ( - onChange(choice, i)} - > - {choice} - - ))} - - ) -} +}) => ( + + {choices.map((choice, i) => ( + onChange(choice, i)} + > + {choice} + + ))} + +) const Wrapper = styled.div` display: flex; @@ -59,3 +57,5 @@ const Choice = styled.div` } `} ` + +export default Toggle