From cb9528d894435761dce4c3b27a03e7888303a7ae Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Thu, 26 Mar 2026 21:30:49 +0100 Subject: [PATCH] refactor: create wide modal variant --- .../common/components/modal/Modal.module.scss | 19 ++++++++++++++++++- .../src/common/components/modal/Modal.tsx | 7 +++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/apps/client/src/common/components/modal/Modal.module.scss b/apps/client/src/common/components/modal/Modal.module.scss index a8e72b1b3..c12561788 100644 --- a/apps/client/src/common/components/modal/Modal.module.scss +++ b/apps/client/src/common/components/modal/Modal.module.scss @@ -11,12 +11,22 @@ background-color: $gray-1250; color: $ui-white; - border-radius: 3px; + border-radius: $component-border-radius-md; box-shadow: $box-shadow-l1; border: 1px solid $gray-1100; outline: none; } +.wide { + top: 4vh; + min-width: min(1280px, 96vw); + max-width: min(1600px, 96vw); + height: 88vh; + max-height: 88vh; + display: flex; + flex-direction: column; +} + .backdrop { position: fixed; inset: 0; @@ -48,6 +58,13 @@ overflow-y: auto; } +.wide .body { + flex: 1; + min-height: 0; + max-height: none; + overflow: hidden; +} + .footer { padding-block: 1rem; display: flex; diff --git a/apps/client/src/common/components/modal/Modal.tsx b/apps/client/src/common/components/modal/Modal.tsx index 57c3be500..a80170247 100644 --- a/apps/client/src/common/components/modal/Modal.tsx +++ b/apps/client/src/common/components/modal/Modal.tsx @@ -2,6 +2,7 @@ import { Dialog as BaseDialog } from '@base-ui/react/dialog'; import type { ReactNode } from 'react'; import { IoClose } from 'react-icons/io5'; +import { cx } from '../../utils/styleUtils'; import IconButton from '../buttons/IconButton'; import style from './Modal.module.scss'; @@ -11,6 +12,7 @@ interface ModalProps { title?: string; showCloseButton?: boolean; showBackdrop?: boolean; + size?: 'default' | 'wide'; bodyElements: ReactNode; footerElements?: ReactNode; onClose: () => void; @@ -21,6 +23,7 @@ export default function Modal({ title, showCloseButton, showBackdrop, + size = 'default', bodyElements, footerElements, onClose, @@ -35,7 +38,7 @@ export default function Modal({ > {showBackdrop && } - +
{title} {showCloseButton && ( @@ -45,7 +48,7 @@ export default function Modal({ )}
{bodyElements}
-
{footerElements}
+ {footerElements ?
{footerElements}
: null}