2021-12-03 20:37:38 +01:00
|
|
|
import React from 'react';
|
2022-03-07 13:22:35 +01:00
|
|
|
import RequestTabs from 'components/RequestTabs';
|
|
|
|
import RequestTabPanel from 'components/RequestTabPanel';
|
|
|
|
import Sidebar from 'components/Sidebar';
|
2021-12-03 20:37:38 +01:00
|
|
|
import StyledWrapper from './StyledWrapper';
|
|
|
|
|
2022-03-07 13:22:35 +01:00
|
|
|
const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
|
|
|
|
if(!SERVER_RENDERED) {
|
|
|
|
require('codemirror/mode/javascript/javascript');
|
|
|
|
require('codemirror/mode/javascript/javascript');
|
|
|
|
require('codemirror/addon/edit/matchbrackets');
|
|
|
|
require('codemirror/addon/fold/brace-fold');
|
|
|
|
require('codemirror/addon/fold/foldgutter');
|
|
|
|
require('codemirror/addon/hint/show-hint');
|
|
|
|
require('codemirror/keymap/sublime');
|
|
|
|
require('codemirror/addon/comment/comment');
|
|
|
|
require('codemirror/addon/edit/closebrackets');
|
|
|
|
require('codemirror/addon/search/search');
|
|
|
|
require('codemirror/addon/search/searchcursor');
|
|
|
|
require('codemirror/addon/search/jump-to-line');
|
|
|
|
require('codemirror/addon/dialog/dialog');
|
2021-12-05 16:45:20 +01:00
|
|
|
|
2022-03-07 13:22:35 +01:00
|
|
|
require('codemirror-graphql/hint');
|
|
|
|
require('codemirror-graphql/lint');
|
|
|
|
require('codemirror-graphql/info');
|
|
|
|
require('codemirror-graphql/jump');
|
|
|
|
require('codemirror-graphql/mode');
|
|
|
|
}
|
2022-03-05 18:19:46 +01:00
|
|
|
|
2021-12-04 12:30:03 +01:00
|
|
|
|
2021-12-03 20:37:38 +01:00
|
|
|
export default function Main() {
|
2022-03-07 13:22:35 +01:00
|
|
|
if (SERVER_RENDERED) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-12-03 20:37:38 +01:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<StyledWrapper>
|
2022-03-13 22:13:36 +01:00
|
|
|
<Sidebar />
|
2021-12-10 19:34:00 +01:00
|
|
|
<section className='flex flex-grow flex-col'>
|
2022-03-13 22:13:36 +01:00
|
|
|
<RequestTabs />
|
|
|
|
<RequestTabPanel />
|
2021-12-03 20:37:38 +01:00
|
|
|
</section>
|
|
|
|
</StyledWrapper>
|
|
|
|
</div>
|
2021-12-30 15:12:04 +01:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|