Skip to content

Commit

Permalink
Fixed modal dialog placement on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
dkildar committed Nov 1, 2024
1 parent 9013c1c commit 5f861c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/features/ui/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ export function Modal(props: Omit<HTMLProps<HTMLDivElement>, "size"> & Props) {
<div
{...nativeProps}
className={classNameObject({
"z-[1040] fixed top-0 py-8 left-0 right-0 bottom-0 overflow-y-auto h-full": true,
"z-[1040] fixed top-0 py-4 md:py-8 left-0 right-0 bottom-0 overflow-y-auto h-full":
true,
[props.className ?? ""]: true,
"flex justify-center items-center": props.centered
"flex justify-center items-start": props.centered
})}
onClick={() => setShow(false)}
>
Expand Down Expand Up @@ -126,7 +127,7 @@ export function Modal(props: Omit<HTMLProps<HTMLDivElement>, "size"> & Props) {
}
onClick={(e) => e.stopPropagation()}
className={classNameObject({
"bg-white rounded-xl w-[calc(100%-2rem)] ecency-modal-content overflow-x-hidden overflow-y-auto max-h-[calc(100vh-3rem)] my-[3rem] mx-3":
"bg-white rounded-xl w-[calc(100%-2rem)] ecency-modal-content overflow-x-hidden md:my-[3rem] mx-3":
true,
"max-w-[500px]": !props.size || props.size === "md",
"max-w-[800px]": props.size === "lg",
Expand Down

0 comments on commit 5f861c6

Please sign in to comment.