Skip to content

Commit bef7139

Browse files
Sharing Redesign: Export feedback changes (grafana#92346)
* adjust height of codeEditor * 75%
1 parent 8cc95a7 commit bef7139

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

public/app/features/dashboard-scene/sharing/ExportButton/ExportAsJson.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,26 @@ function ExportAsJsonRenderer({ model }: SceneComponentProps<ExportAsJson>) {
5656
/>
5757
<Label>{switchLabel}</Label>
5858
</Stack>
59-
<AutoSizer disableHeight className={styles.codeEditorBox} data-testid={selector.codeEditor}>
60-
{({ width }) => {
61-
if (dashboardJson.value) {
62-
return (
63-
<CodeEditor
64-
value={dashboardJson.value}
65-
language="json"
66-
showMiniMap={false}
67-
height="500px"
68-
width={width}
69-
readOnly={true}
70-
/>
71-
);
72-
}
59+
<div className={styles.codeEditorBox}>
60+
<AutoSizer data-testid={selector.codeEditor}>
61+
{({ width, height }) => {
62+
if (dashboardJson.value) {
63+
return (
64+
<CodeEditor
65+
value={dashboardJson.value}
66+
language="json"
67+
showMiniMap={false}
68+
height={height}
69+
width={width}
70+
readOnly={true}
71+
/>
72+
);
73+
}
7374

74-
return dashboardJson.loading && <Spinner />;
75-
}}
76-
</AutoSizer>
75+
return dashboardJson.loading && <Spinner />;
76+
}}
77+
</AutoSizer>
78+
</div>
7779
<div className={styles.container}>
7880
<Stack gap={1} flex={1} direction={{ xs: 'column', sm: 'row' }}>
7981
<Button
@@ -111,6 +113,7 @@ function getStyles(theme: GrafanaTheme2) {
111113
return {
112114
codeEditorBox: css({
113115
margin: `${theme.spacing(2)} 0`,
116+
height: '75%',
114117
}),
115118
container: css({
116119
paddingBottom: theme.spacing(2),

0 commit comments

Comments
 (0)