Skip to content

Commit

Permalink
update code editor height
Browse files Browse the repository at this point in the history
  • Loading branch information
vitPinchuk committed Aug 22, 2024
1 parent 068bce4 commit 1cdeeb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ export const getStyles = (theme: GrafanaTheme2) => {
`,
modal: css`
width: 80%;
height: 80%;
`,
content: css`
padding: ${theme.spacing(1)};
height: 100%;
`,
modalBody: css`
height: 100%;
`,
modalIconLine: css`
margin: ${theme.spacing(0.5)} 0 0 ${theme.spacing(0.5)};
`,
modalEditor: css`
height: 100%;
border-radius: 2px;
border: 1px solid ${theme.colors.border.medium};
`,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Props = React.ComponentProps<typeof CodeEditor> & {
minHeight?: number;
maxHeight?: number;
modalTitle: string;
modalHeight?: number;
modalButtonTooltip: string;
};

Expand Down Expand Up @@ -53,7 +52,6 @@ export const AutosizeCodeEditor: React.FC<Props> = ({
maxHeight,
height: staticHeight,
modalTitle,
modalHeight,
modalButtonTooltip,
onEditorDidMount,
...restProps
Expand Down Expand Up @@ -149,6 +147,7 @@ export const AutosizeCodeEditor: React.FC<Props> = ({
isOpen={isOpen}
onDismiss={() => setIsOpen(false)}
className={styles.modal}
contentClassName={styles.modalBody}
closeOnEscape
trapFocus
>
Expand All @@ -160,7 +159,7 @@ export const AutosizeCodeEditor: React.FC<Props> = ({
onChange?.(value);
setHeight(getHeightByValue(value, minHeight, maxHeight));
}}
height={modalHeight}
containerStyles={styles.modalEditor}
onEditorDidMount={modalEditorDidMount}
{...restProps}
/>
Expand Down

0 comments on commit 1cdeeb0

Please sign in to comment.