Shared: ModalDialog: Removed backdrop changes when swiping.

This commit is contained in:
Tatiana Lopaeva 2024-08-27 18:20:03 +03:00
parent d0806a346b
commit a59a076ffe
2 changed files with 3 additions and 14 deletions

View File

@ -131,7 +131,6 @@ const Modal = ({
className={visible ? "modal-backdrop-active backdrop-active" : ""}
visible
zIndex={zIndex}
modalSwipeOffset={modalSwipeOffset}
>
<Dialog
id="modal-onMouseDown-close"

View File

@ -42,13 +42,7 @@ const backdropBackground = (props: {
return `rgba(${r}, ${g}, ${b}, ${a + swipeOffset * (a / 120)})`;
};
const StyledModalBackdrop = styled.div.attrs(
(props: { theme: TTheme; modalSwipeOffset?: number; zIndex?: number }) => ({
style: {
background: backdropBackground(props),
},
}),
)<{ modalSwipeOffset?: number; zIndex?: number }>`
const StyledModalBackdrop = styled.div<{ zIndex?: number }>`
display: block;
height: 100%;
min-height: fill-available;
@ -59,6 +53,7 @@ const StyledModalBackdrop = styled.div.attrs(
left: 0;
top: 0;
background: ${(props) => props.theme.backdrop.backgroundColor};
z-index: ${(props) => props.zIndex};
@media ${mobile} {
@ -75,15 +70,10 @@ const StyledModalBackdrop = styled.div.attrs(
const ModalBackdrop = ({
className,
zIndex,
modalSwipeOffset,
children,
}: ModalDialogBackdropProps) => {
return (
<StyledModalBackdrop
zIndex={zIndex}
className={className}
modalSwipeOffset={modalSwipeOffset}
>
<StyledModalBackdrop zIndex={zIndex} className={className}>
{children}
</StyledModalBackdrop>
);