Skip to content

Commit

Permalink
fix: edit modal size (#899)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleksandr Raspopov <[email protected]>
  • Loading branch information
Alexander-frenki and Oleksandr Raspopov authored Jan 27, 2025
1 parent bae1f7c commit c4a73bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/src/components/payments/PaymentOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export function PaymentOption() {
<EditModal
onClose={() => setIsEditModalOpen(false)}
open={isEditModalOpen}
size="large"
title="Edit payment option"
>
<PaymentOptionForm
Expand Down
9 changes: 8 additions & 1 deletion ui/src/components/shared/EditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ import { Divider, Modal } from "antd";
import { ReactNode } from "react";
import IconClose from "src/assets/icons/x.svg?react";

const MODAL_SIZES = {
large: 800,
small: 520,
};

export function EditModal({
children,
onClose,
open,
size = "small",
title,
}: {
children: ReactNode;
onClose: () => void;
open: boolean;
size: "small" | "large";
title: string;
}) {
return (
Expand All @@ -23,8 +30,8 @@ export function EditModal({
maskClosable
onCancel={onClose}
open={open}
style={{ maxWidth: 600 }}
title={title}
width={MODAL_SIZES[size]}
>
<Divider />
{children}
Expand Down

0 comments on commit c4a73bc

Please sign in to comment.