File tree Expand file tree Collapse file tree 5 files changed +17
-17
lines changed Expand file tree Collapse file tree 5 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 201201 "react-data-grid" : " ^4.0.8" ,
202202 "react-dom" : " ^16.2.0" ,
203203 "react-draggable" : " ^3.0.5" ,
204+ "react-highlight" : " ^0.12.0" ,
204205 "react-redux" : " ^5.0.6" ,
205206 "react-router-dom" : " ^4.2.2" ,
206207 "react-timeago" : " ^4.1.9" ,
Original file line number Diff line number Diff line change 9595 z-index : 1000 ;
9696 }
9797
98- .editor-outer {
98+ pre {
99+ bottom : 0 ;
99100 flex : 1 ;
101+ margin : 0 ;
102+ padding-left : 12px ;
103+ position : absolute ;
104+ top : 0 ;
100105 width : 100% ;
101- .CodeMirror {
102- box-shadow : inset #ccc 0 0 1px 1px ;
103- }
104106 }
105107 }
106108 }
Original file line number Diff line number Diff line change 88
99import React from "react" ;
1010import Clipboard from "react-clipboard.js" ;
11+ import Highlight from "react-highlight" ;
1112
12- import Editor from "containers/Editor ";
13+ import "highlight.js/styles/atom-one-light.css ";
1314
1415const STATE_IDLE = 0 ;
1516const STATE_ERROR = - 1 ;
@@ -61,7 +62,7 @@ export default class FrameCodeTab extends React.Component {
6162 } ;
6263
6364 render ( ) {
64- const { code, mode } = this . props ;
65+ const { code } = this . props ;
6566 const { copyState } = this . state ;
6667 const json =
6768 typeof code === "string"
@@ -86,12 +87,11 @@ export default class FrameCodeTab extends React.Component {
8687 </ span >
8788 </ Clipboard >
8889
89- < Editor
90- key = { json . length }
91- query = { json }
92- mode = { mode || "javascript" }
93- readOnly = "nocursor"
94- />
90+ { json && json . length > 16000 ? (
91+ < pre > { json } </ pre >
92+ ) : (
93+ < Highlight > { json } </ Highlight >
94+ ) }
9595 </ div >
9696 ) ;
9797 }
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ function FrameSession(props) {
182182 ) : null }
183183
184184 { currentTab === "userQuery" ? (
185- < FrameCodeTab code = { frame . query } mode = "graphql" />
185+ < FrameCodeTab code = { frame . query } />
186186 ) : null }
187187 </ div >
188188 ) ;
Original file line number Diff line number Diff line change @@ -68,10 +68,7 @@ URL: ${error.url}
6868 currentTab === "jsonResponse" ,
6969 < FrameCodeTab code = { isError ? error : response } /> ,
7070 ) }
71- { _if (
72- currentTab === "userQuery" ,
73- < FrameCodeTab code = { query } mode = "graphql" /> ,
74- ) }
71+ { _if ( currentTab === "userQuery" , < FrameCodeTab code = { query } /> ) }
7572
7673 { _if (
7774 isError ,
You can’t perform that action at this time.
0 commit comments