Skip to content

Commit 0bdb965

Browse files
authored
Grafana UI: Modal - Replace HorizontalGroup with Stack (#85756)
1 parent 0f1b65a commit 0bdb965

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

.betterer.results

-3
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,6 @@ exports[`better eslint`] = {
864864
"packages/grafana-ui/src/components/Menu/Menu.story.tsx:5381": [
865865
[0, 0, 0, "\'VerticalGroup\' import from \'../Layout/Layout\' is restricted from being used by a pattern. Use Stack component instead.", "0"]
866866
],
867-
"packages/grafana-ui/src/components/Modal/Modal.tsx:5381": [
868-
[0, 0, 0, "\'HorizontalGroup\' import from \'../Layout/Layout\' is restricted from being used by a pattern. Use Stack component instead.", "0"]
869-
],
870867
"packages/grafana-ui/src/components/Modal/ModalsContext.tsx:5381": [
871868
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
872869
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],

packages/grafana-ui/src/components/Modal/Modal.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useStyles2 } from '../../themes';
88
import { IconName } from '../../types';
99
import { t } from '../../utils/i18n';
1010
import { IconButton } from '../IconButton/IconButton';
11-
import { HorizontalGroup } from '../Layout/Layout';
11+
import { Stack } from '../Layout/Stack/Stack';
1212

1313
import { ModalHeader } from './ModalHeader';
1414
import { getModalStyles } from './getModalStyles';
@@ -105,23 +105,23 @@ function ModalButtonRow({ leftItems, children }: { leftItems?: React.ReactNode;
105105
if (leftItems) {
106106
return (
107107
<div className={styles.modalButtonRow}>
108-
<HorizontalGroup justify="space-between">
109-
<HorizontalGroup justify="flex-start" spacing="md">
108+
<Stack justifyContent="space-between">
109+
<Stack justifyContent="flex-start" gap={2}>
110110
{leftItems}
111-
</HorizontalGroup>
112-
<HorizontalGroup justify="flex-end" spacing="md">
111+
</Stack>
112+
<Stack justifyContent="flex-end" gap={2}>
113113
{children}
114-
</HorizontalGroup>
115-
</HorizontalGroup>
114+
</Stack>
115+
</Stack>
116116
</div>
117117
);
118118
}
119119

120120
return (
121121
<div className={styles.modalButtonRow}>
122-
<HorizontalGroup justify="flex-end" spacing="md" wrap={true}>
122+
<Stack justifyContent="flex-end" gap={2} wrap="wrap">
123123
{children}
124-
</HorizontalGroup>
124+
</Stack>
125125
</div>
126126
);
127127
}

0 commit comments

Comments
 (0)