Skip to content

Commit b0a1ada

Browse files
authored
fix: query editor height and width (#14)
1 parent 854841a commit b0a1ada

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/components/QueryEditor.tsx

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CodeEditor, InlineField, Stack } from '@grafana/ui';
1+
import { CodeEditor, Field } from '@grafana/ui';
22
import { TpDataSourceOptions, TpQuery } from '../types';
33

44
import { DataSource } from '../datasource';
@@ -15,18 +15,16 @@ export function QueryEditor({ query, onChange }: Props) {
1515
const { sql } = query;
1616

1717
return (
18-
<Stack gap={0}>
19-
<InlineField label="Query" labelWidth={16} tooltip="Not used yet">
20-
<CodeEditor
21-
onChange={onSQLChange}
22-
width={600}
23-
height={200}
24-
language="sql"
25-
showLineNumbers={true}
26-
showMiniMap={false}
27-
value={sql || ''}
28-
/>
29-
</InlineField>
30-
</Stack>
18+
<Field>
19+
<CodeEditor
20+
onChange={onSQLChange}
21+
width="100%"
22+
height={200}
23+
language="sql"
24+
showLineNumbers={true}
25+
showMiniMap={false}
26+
value={sql || ''}
27+
/>
28+
</Field>
3129
);
3230
}

src/components/VariableQueryEditor.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryProps) =>
2424
<CodeEditor
2525
onChange={onSQLChange}
2626
onBlur={saveQuery}
27-
width={600}
28-
height={100}
27+
width="100%"
28+
height={200}
2929
language="sql"
3030
showLineNumbers={true}
3131
showMiniMap={false}

0 commit comments

Comments
 (0)