mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 04:08:01 +02:00
chore: codemirror editor occupy remaing height
This commit is contained in:
parent
6812494d6b
commit
2007ff3a67
@ -50,9 +50,6 @@ const StyledWrapper = styled.div`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-tabs__tab-panel--selected {
|
|
||||||
height: 90%;
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default StyledWrapper;
|
export default StyledWrapper;
|
@ -13,6 +13,7 @@ const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryCh
|
|||||||
<Tab tabIndex="-1">Headers</Tab>
|
<Tab tabIndex="-1">Headers</Tab>
|
||||||
</TabList>
|
</TabList>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
<div className="mt-4">
|
||||||
<QueryEditor
|
<QueryEditor
|
||||||
schema={schema}
|
schema={schema}
|
||||||
width={leftPaneWidth}
|
width={leftPaneWidth}
|
||||||
@ -20,6 +21,7 @@ const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryCh
|
|||||||
onRunQuery={onRunQuery}
|
onRunQuery={onRunQuery}
|
||||||
onEdit={onQueryChange}
|
onEdit={onQueryChange}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<RequestHeaders />
|
<RequestHeaders />
|
||||||
|
@ -3,7 +3,8 @@ import styled from 'styled-components';
|
|||||||
const StyledWrapper = styled.div`
|
const StyledWrapper = styled.div`
|
||||||
div.CodeMirror {
|
div.CodeMirror {
|
||||||
border: solid 1px var(--color-codemirror-border);
|
border: solid 1px var(--color-codemirror-border);
|
||||||
height: 96%;
|
/* todo: find a better way */
|
||||||
|
height: calc(100vh - 230px);
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea.cm-editor {
|
textarea.cm-editor {
|
||||||
|
@ -169,7 +169,7 @@ export default class QueryEditor extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<StyledWrapper
|
<StyledWrapper
|
||||||
className="mt-4 h-full"
|
className="h-full"
|
||||||
aria-label="Query Editor"
|
aria-label="Query Editor"
|
||||||
ref={node => {
|
ref={node => {
|
||||||
this._node = node;
|
this._node = node;
|
||||||
|
@ -3,6 +3,8 @@ import styled from 'styled-components';
|
|||||||
const StyledWrapper = styled.div`
|
const StyledWrapper = styled.div`
|
||||||
div.CodeMirror {
|
div.CodeMirror {
|
||||||
border: solid 1px var(--color-codemirror-border);
|
border: solid 1px var(--color-codemirror-border);
|
||||||
|
/* todo: find a better way */
|
||||||
|
height: calc(100vh - 230px);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.overlay{
|
div.overlay{
|
||||||
|
@ -37,7 +37,7 @@ const QueryResult = ({data, isLoading, width}) => {
|
|||||||
}, [editor.current, cmEditor, data]);
|
}, [editor.current, cmEditor, data]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledWrapper className="mt-4 w-full" style={{position: 'relative', height: '90%'}}>
|
<StyledWrapper className="mt-4 w-full">
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="overlay">
|
<div className="overlay">
|
||||||
<div style={{marginBottom: 15, fontSize: 26}}>
|
<div style={{marginBottom: 15, fontSize: 26}}>
|
||||||
@ -53,7 +53,7 @@ const QueryResult = ({data, isLoading, width}) => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div>
|
<div className="h-full">
|
||||||
<textarea
|
<textarea
|
||||||
id="operation"
|
id="operation"
|
||||||
style={{
|
style={{
|
||||||
|
@ -6,8 +6,8 @@ const ResponseTime = ({duration}) => {
|
|||||||
|
|
||||||
if(duration > 1000 ) { // duration greater than a second
|
if(duration > 1000 ) { // duration greater than a second
|
||||||
let seconds = Math.floor(duration / 1000);
|
let seconds = Math.floor(duration / 1000);
|
||||||
let decimal = ((duration % 1000) / 1000).toFixed(2) * 100;
|
let decimal = ((duration % 1000) / 1000) * 100;
|
||||||
durationToDisplay = seconds + '.' + decimal + 's';
|
durationToDisplay = seconds + '.' + decimal.toFixed(0) + 's';
|
||||||
} else {
|
} else {
|
||||||
durationToDisplay = duration + 'ms'
|
durationToDisplay = duration + 'ms'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user