Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SW-7037] Fix the modal responsivity #146

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface IModalProps {
}

const ModalVariants = cva(
"fixed left-1/2 top-1/2 z-[100] h-auto min-w-[40rem] max-w-[52rem] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-white",
"fixed z-[100] h-auto w-full rounded-lg bg-white max-md:bottom-0 md:left-1/2 md:top-1/2 md:min-w-[40rem] md:max-w-[52rem] md:-translate-x-1/2 md:-translate-y-1/2",
{
variants: {
open: {
Expand All @@ -34,17 +34,14 @@ const ModalVariants = cva(
},
);

const BgVariants = cva(
"fixed right-0 top-0 z-50 h-full w-screen bg-gray-500 opacity-40 max-md:hidden",
{
variants: {
open: {
true: "",
false: "hidden",
},
const BgVariants = cva("fixed right-0 top-0 z-50 h-full w-screen bg-gray-500 opacity-40", {
variants: {
open: {
true: "",
false: "hidden",
},
},
);
});

const CancelButtonVariants = cva("w-full rounded-md border py-3", {
variants: {
Expand Down Expand Up @@ -105,7 +102,7 @@ const Modal = ({
/>
<div className="h-fit">{children}</div>
{buttons && (
<div className="mt-8 flex gap-4">
<div className="mt-8 flex gap-4 max-md:flex-col">
<Button
label={cancelLabel}
onClick={onClickCancel}
Expand Down