bruno/renderer/components/GraphQLRequestPane/index.js

35 lines
1021 B
JavaScript
Raw Normal View History

import React from 'react';
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
import StyledWrapper from './StyledWrapper';
import QueryEditor from '../QueryEditor';
2021-12-31 17:22:22 +01:00
import RequestHeaders from '../RequestHeaders';
2022-01-20 17:04:44 +01:00
const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryChange}) => {
return (
2022-01-07 20:26:10 +01:00
<StyledWrapper className="h-full">
<Tabs className='react-tabs mt-1 flex flex-grow flex-col h-full' forceRenderTabPanel>
<TabList>
<Tab tabIndex="-1">Query</Tab>
<Tab tabIndex="-1">Headers</Tab>
</TabList>
<TabPanel>
<div className="mt-4">
<QueryEditor
schema={schema}
width={leftPaneWidth}
value={value}
onRunQuery={onRunQuery}
onEdit={onQueryChange}
/>
</div>
</TabPanel>
<TabPanel>
2021-12-31 17:22:22 +01:00
<RequestHeaders />
</TabPanel>
</Tabs>
</StyledWrapper>
)
};
2022-01-20 17:04:44 +01:00
export default GraphQLRequestPane;