chore: codemirror editor occupy remaing height

This commit is contained in:
Anoop M D 2022-01-26 03:00:21 +05:30
parent 6812494d6b
commit 2007ff3a67
7 changed files with 18 additions and 16 deletions

View File

@ -50,9 +50,6 @@ const StyledWrapper = styled.div`
}
}
.react-tabs__tab-panel--selected {
height: 90%;
}
`;
export default StyledWrapper;

View File

@ -13,13 +13,15 @@ const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryCh
<Tab tabIndex="-1">Headers</Tab>
</TabList>
<TabPanel>
<QueryEditor
schema={schema}
width={leftPaneWidth}
value={value}
onRunQuery={onRunQuery}
onEdit={onQueryChange}
/>
<div className="mt-4">
<QueryEditor
schema={schema}
width={leftPaneWidth}
value={value}
onRunQuery={onRunQuery}
onEdit={onQueryChange}
/>
</div>
</TabPanel>
<TabPanel>
<RequestHeaders />

View File

@ -3,7 +3,8 @@ import styled from 'styled-components';
const StyledWrapper = styled.div`
div.CodeMirror {
border: solid 1px var(--color-codemirror-border);
height: 96%;
/* todo: find a better way */
height: calc(100vh - 230px);
}
textarea.cm-editor {

View File

@ -169,7 +169,7 @@ export default class QueryEditor extends React.Component {
render() {
return (
<StyledWrapper
className="mt-4 h-full"
className="h-full"
aria-label="Query Editor"
ref={node => {
this._node = node;

View File

@ -3,6 +3,8 @@ import styled from 'styled-components';
const StyledWrapper = styled.div`
div.CodeMirror {
border: solid 1px var(--color-codemirror-border);
/* todo: find a better way */
height: calc(100vh - 230px);
}
div.overlay{

View File

@ -37,7 +37,7 @@ const QueryResult = ({data, isLoading, width}) => {
}, [editor.current, cmEditor, data]);
return (
<StyledWrapper className="mt-4 w-full" style={{position: 'relative', height: '90%'}}>
<StyledWrapper className="mt-4 w-full">
{isLoading && (
<div className="overlay">
<div style={{marginBottom: 15, fontSize: 26}}>
@ -53,7 +53,7 @@ const QueryResult = ({data, isLoading, width}) => {
</button>
</div>
)}
<div>
<div className="h-full">
<textarea
id="operation"
style={{

View File

@ -6,8 +6,8 @@ const ResponseTime = ({duration}) => {
if(duration > 1000 ) { // duration greater than a second
let seconds = Math.floor(duration / 1000);
let decimal = ((duration % 1000) / 1000).toFixed(2) * 100;
durationToDisplay = seconds + '.' + decimal + 's';
let decimal = ((duration % 1000) / 1000) * 100;
durationToDisplay = seconds + '.' + decimal.toFixed(0) + 's';
} else {
durationToDisplay = duration + 'ms'
}