@@ -25,7 +25,6 @@ import {
25
25
Viewer ,
26
26
} from '../../types'
27
27
import { download } from './util/index'
28
- import QueryHeader from './QueryHeader'
29
28
import ResultHeader from './ResultHeader'
30
29
import { Response } from '../Playground'
31
30
import HttpHeaders , { Header } from './HttpHeaders'
@@ -37,9 +36,7 @@ import { getVariableNamesFromQuery, putVariablesToQuery } from './ast'
37
36
import { flatMap , groupBy } from 'lodash'
38
37
import Results from './Results'
39
38
import ReponseTracing from './ResponseTracing'
40
-
41
- // tslint:disable-next-line
42
- const CSSTransitionGroup = require ( 'react-transition-group/CSSTransitionGroup' )
39
+ import GenerateCodeButton from './GenerateCodeButton'
43
40
44
41
/**
45
42
* The top-level React component for GraphQLEditor, intended to encompass the entire
@@ -401,13 +398,12 @@ export class GraphQLEditor extends React.PureComponent<Props, State> {
401
398
padding: 5px 9px 6px 9px;
402
399
letter-spacing: 0.53px;
403
400
}
404
- .graphiql-button.generate-code {
401
+ .graphiql-button.prettify {
405
402
@p: .absolute;
406
403
top: -57px;
407
- right: 25px ;
404
+ right: 38px ;
408
405
z-index: 2;
409
406
}
410
-
411
407
.download-button {
412
408
@p: .white50, .bgDarkBlue, .ttu, .f14, .fw6, .br2, .pointer,
413
409
.absolute;
@@ -475,27 +471,6 @@ export class GraphQLEditor extends React.PureComponent<Props, State> {
475
471
onMouseDown = { this . handleResizeStart }
476
472
>
477
473
< div className = "queryWrap" style = { queryWrapStyle } >
478
- { this . props . disableAnimation ? (
479
- < QueryHeader
480
- onPrettify = { this . handlePrettifyQuery }
481
- showEndpoints = { this . props . showEndpoints }
482
- showQueryTitle = { this . props . showQueryTitle }
483
- />
484
- ) : (
485
- < CSSTransitionGroup
486
- transitionName = "query-header"
487
- transitionEnterTimeout = { 500 }
488
- transitionLeaveTimeout = { 300 }
489
- >
490
- { ! this . props . disableQueryHeader && (
491
- < QueryHeader
492
- onPrettify = { this . handlePrettifyQuery }
493
- showEndpoints = { this . props . showEndpoints }
494
- showQueryTitle = { this . props . showQueryTitle }
495
- />
496
- ) }
497
- </ CSSTransitionGroup >
498
- ) }
499
474
< QueryEditor
500
475
ref = { this . setQueryEditorComponent }
501
476
schema = { this . state . schema }
@@ -514,14 +489,15 @@ export class GraphQLEditor extends React.PureComponent<Props, State> {
514
489
headers = { this . props . headers }
515
490
onChange = { this . props . onChangeHeaders }
516
491
/>
517
- { this . props . showCodeGeneration && (
518
- < div
519
- className = "graphiql-button generate-code"
520
- onClick = { this . props . onClickCodeGeneration }
521
- >
522
- Generate Code
523
- </ div >
524
- ) }
492
+ < div
493
+ className = "graphiql-button prettify"
494
+ onClick = { this . handlePrettifyQuery }
495
+ >
496
+ Prettify
497
+ </ div >
498
+ < GenerateCodeButton
499
+ onOpenCodeGeneration = { this . props . onClickCodeGeneration }
500
+ />
525
501
< div
526
502
className = "variable-editor-title"
527
503
style = { { cursor : variableOpen ? 'row-resize' : 'n-resize' } }
0 commit comments