diff --git a/packages/graphql-playground-react/src/components/Playground.tsx b/packages/graphql-playground-react/src/components/Playground.tsx index a0bccf6ba..bdc8f68e5 100644 --- a/packages/graphql-playground-react/src/components/Playground.tsx +++ b/packages/graphql-playground-react/src/components/Playground.tsx @@ -59,6 +59,7 @@ export interface Props { endpoint: string subscriptionEndpoint?: string projectId?: string + shareEnabled?: boolean adminAuthToken?: string onSuccess?: (graphQLParams: any, response: any) => void isEndpoint?: boolean @@ -123,6 +124,10 @@ export interface CursorPosition { export { GraphQLEditor } export class Playground extends React.PureComponent { + static defaultProps = { + shareEnabled: true, + } + apolloLinks: { [sessionId: string]: any } = {} observers: { [sessionId: string]: any } = {} graphiqlComponents: any[] = [] @@ -277,7 +282,10 @@ export class Playground extends React.PureComponent { ) : this.props.isFile && this.props.file ? ( ) : ( - + )} diff --git a/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx b/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx index 20b784a31..ab57118c7 100644 --- a/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx +++ b/packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx @@ -67,6 +67,7 @@ import { ResponseRecord } from '../../state/sessions/reducers' export interface Props { onRef?: any + shareEnabled?: boolean schema?: GraphQLSchema } @@ -248,7 +249,7 @@ class GraphQLEditor extends React.PureComponent< } `}
- +
{ )} - - - + {this.props.shareEnabled && ( + + + + )} ) }