Skip to content

Commit

Permalink
fix(Modal): used floatingUI component for modal overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinsawicki committed Feb 2, 2024
1 parent 58eb0d0 commit 6b1c2b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
display: flex;
position: relative;
flex-direction: column;
margin: 10px;
margin: auto;
border-radius: var(--radius-3);
box-shadow: 0 20px 60px 0 rgb(0 0 0 / 30%);
Expand All @@ -18,18 +17,10 @@

&__overlay {
display: none;
position: fixed;
top: 0;
left: 0;
justify-content: center;
z-index: 13000;
background-color: var(--surface-other-overlay);
width: 100%;
height: 100%;

&--visible {
display: flex;
overflow-y: auto;
}

&--labelled {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';

import { FloatingOverlay } from '@floating-ui/react';
import cx from 'clsx';

import { KeyCodes } from '../../../utils/keyCodes';
Expand Down Expand Up @@ -69,7 +70,7 @@ export const ModalBase: React.FC<React.PropsWithChildren<ModalBaseProps>> = ({
};

return (
<div
<FloatingOverlay
data-testid="lc-modal-overlay"
onMouseDown={onOverlayClick}
className={cx(
Expand All @@ -86,6 +87,6 @@ export const ModalBase: React.FC<React.PropsWithChildren<ModalBaseProps>> = ({
>
{children}
</div>
</div>
</FloatingOverlay>
);
};

0 comments on commit 6b1c2b1

Please sign in to comment.