Skip to content

Commit 79d1fcc

Browse files
committed
fix: custom offset
1 parent 0a7d79e commit 79d1fcc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/HoverPopup/HoverPopup.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface HoverPopupProps {
1313
children: React.ReactNode;
1414
popupContent: React.ReactNode;
1515
showPopup?: boolean;
16+
offset?: [number, number];
1617
onShowPopup?: VoidFunction;
1718
onHidePopup?: VoidFunction;
1819
}
@@ -21,6 +22,7 @@ export const HoverPopup = ({
2122
children,
2223
popupContent,
2324
showPopup,
25+
offset,
2426
onShowPopup,
2527
onHidePopup,
2628
}: HoverPopupProps) => {
@@ -99,7 +101,7 @@ export const HoverPopup = ({
99101
hasArrow
100102
// bigger offset for easier switching to neighbour nodes
101103
// matches the default offset for popup with arrow out of a sense of beauty
102-
offset={[0, 12]}
104+
offset={offset || [0, 12]}
103105
>
104106
<div onContextMenu={onPopupContextMenu}>{popupContent}</div>
105107
</Popup>

src/containers/Storage/PDisk/PDisk.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const PDisk = ({
7676
onShowPopup={onShowPopup}
7777
onHidePopup={onHidePopup}
7878
popupContent={<PDiskPopup data={data} />}
79+
offset={vDisks?.length ? [0, 28] : undefined}
7980
>
8081
<InternalLink to={pDiskPath} className={b('content')}>
8182
<DiskStateProgressBar

0 commit comments

Comments
 (0)