Skip to content

Commit c26b211

Browse files
fix(Fullscreen): fix overlay and root
1 parent 8c1cb87 commit c26b211

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

src/components/EnableFullscreenButton/EnableFullscreenButton.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ interface EnableFullscreenButtonProps {
1212
view?: ButtonView;
1313
}
1414

15-
function EnableFullscreenButton({disabled, view = 'flat-secondary'}: EnableFullscreenButtonProps) {
15+
export function EnableFullscreenButton({
16+
disabled,
17+
view = 'flat-secondary',
18+
}: EnableFullscreenButtonProps) {
1619
const dispatch = useTypedDispatch();
1720
const onEnableFullscreen = () => {
1821
dispatch(enableFullscreen());
@@ -25,5 +28,3 @@ function EnableFullscreenButton({disabled, view = 'flat-secondary'}: EnableFulls
2528
</ActionTooltip>
2629
);
2730
}
28-
29-
export default EnableFullscreenButton;

src/components/Fullscreen/Fullscreen.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
.ydb-fullscreen {
2+
--ydb-fullscreen-z-index: 1000;
3+
24
overflow: hidden;
35
flex-grow: 1;
46

57
&_fullscreen {
68
// should expand to fill the content area, keeping aside navigation visible
79
// counts on .gn-aside-header__content to have position: relative, it is set in App.scss
810
position: absolute;
9-
z-index: 10;
11+
z-index: var(--ydb-fullscreen-z-index);
1012
inset: 0;
1113

1214
background-color: var(--g-color-base-background);
1315
}
1416

1517
&__close-button {
1618
position: fixed;
17-
z-index: 11;
19+
z-index: calc(var(--ydb-fullscreen-z-index) + 1);
1820
top: 8px;
1921
right: 20px;
2022

src/components/Fullscreen/Fullscreen.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ interface FullscreenProps {
1818
className?: string;
1919
}
2020

21-
const fullscreenRoot = document.getElementById('fullscreen-root') ?? undefined;
22-
23-
function Fullscreen({children, className}: FullscreenProps) {
21+
export function Fullscreen({children, className}: FullscreenProps) {
2422
const isFullscreen = useTypedSelector((state) => state.fullscreen);
2523
const dispatch = useTypedDispatch();
2624

25+
const fullscreenRoot = React.useMemo(
26+
() => document.getElementById('fullscreen-root') ?? undefined,
27+
[],
28+
);
29+
2730
const onDisableFullScreen = React.useCallback(() => {
2831
dispatch(disableFullscreen());
2932
}, [dispatch]);
@@ -51,7 +54,7 @@ function Fullscreen({children, className}: FullscreenProps) {
5154
setContainer(null);
5255
div.remove();
5356
};
54-
}, []);
57+
}, [fullscreenRoot]);
5558

5659
const ref = React.useRef<HTMLDivElement>(null);
5760
React.useLayoutEffect(() => {
@@ -62,7 +65,7 @@ function Fullscreen({children, className}: FullscreenProps) {
6265
ref.current?.appendChild(container);
6366
}
6467
}
65-
}, [container, isFullscreen]);
68+
}, [container, fullscreenRoot, isFullscreen]);
6669

6770
if (!container) {
6871
return null;
@@ -85,5 +88,3 @@ function Fullscreen({children, className}: FullscreenProps) {
8588
</div>
8689
);
8790
}
88-
89-
export default Fullscreen;

src/containers/Tenant/Diagnostics/TopicData/TopicData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {isNil} from 'lodash';
66

77
import {DrawerWrapper} from '../../../../components/Drawer';
88
import {EmptyFilter} from '../../../../components/EmptyFilter/EmptyFilter';
9-
import EnableFullscreenButton from '../../../../components/EnableFullscreenButton/EnableFullscreenButton';
9+
import {EnableFullscreenButton} from '../../../../components/EnableFullscreenButton/EnableFullscreenButton';
1010
import {PageError} from '../../../../components/Errors/PageError/PageError';
11-
import Fullscreen from '../../../../components/Fullscreen/Fullscreen';
11+
import {Fullscreen} from '../../../../components/Fullscreen/Fullscreen';
1212
import {
1313
DEFAULT_TABLE_ROW_HEIGHT,
1414
ResizeablePaginatedTable,

src/containers/Tenant/Healthcheck/Healthcheck.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import {Flex, Icon} from '@gravity-ui/uikit';
44

55
import {ResponseError} from '../../../components/Errors/ResponseError';
6-
import Fullscreen from '../../../components/Fullscreen/Fullscreen';
6+
import {Fullscreen} from '../../../components/Fullscreen/Fullscreen';
77
import {HealthcheckStatus} from '../../../components/HealthcheckStatus/HealthcheckStatus';
88
import {Illustration} from '../../../components/Illustration';
99
import {Loader} from '../../../components/Loader';

src/containers/Tenant/Query/Preview/components/PreviewView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React from 'react';
33
import {Xmark} from '@gravity-ui/icons';
44
import {Button, Flex, Icon, Text} from '@gravity-ui/uikit';
55

6-
import EnableFullscreenButton from '../../../../../components/EnableFullscreenButton/EnableFullscreenButton';
7-
import Fullscreen from '../../../../../components/Fullscreen/Fullscreen';
6+
import {EnableFullscreenButton} from '../../../../../components/EnableFullscreenButton/EnableFullscreenButton';
7+
import {Fullscreen} from '../../../../../components/Fullscreen/Fullscreen';
88
import {LoaderWrapper} from '../../../../../components/LoaderWrapper/LoaderWrapper';
99
import {setShowPreview} from '../../../../../store/reducers/schema/schema';
1010
import {useTypedDispatch} from '../../../../../utils/hooks';

src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type {Settings} from '@gravity-ui/react-data-table';
55
import type {ControlGroupOption} from '@gravity-ui/uikit';
66
import {ClipboardButton, Flex, SegmentedRadioGroup, Text} from '@gravity-ui/uikit';
77

8-
import EnableFullscreenButton from '../../../../components/EnableFullscreenButton/EnableFullscreenButton';
9-
import Fullscreen from '../../../../components/Fullscreen/Fullscreen';
8+
import {EnableFullscreenButton} from '../../../../components/EnableFullscreenButton/EnableFullscreenButton';
9+
import {Fullscreen} from '../../../../components/Fullscreen/Fullscreen';
1010
import {Illustration} from '../../../../components/Illustration';
1111
import {LoaderWrapper} from '../../../../components/LoaderWrapper/LoaderWrapper';
1212
import {QueryExecutionStatus} from '../../../../components/QueryExecutionStatus';

src/containers/Tenant/TenantDrawerHealthcheck.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {ArrowDownToLine} from '@gravity-ui/icons';
44
import {ActionTooltip, Button, Flex, Icon, Text} from '@gravity-ui/uikit';
55

66
import {DrawerWrapper} from '../../components/Drawer';
7-
import EnableFullscreenButton from '../../components/EnableFullscreenButton/EnableFullscreenButton';
7+
import {EnableFullscreenButton} from '../../components/EnableFullscreenButton/EnableFullscreenButton';
88
import {
99
selectAllHealthcheckInfo,
1010
selectCheckStatus,

0 commit comments

Comments
 (0)