From ffdf7e4de0a7004a1c69f155f6e29fdaf8c67cee Mon Sep 17 00:00:00 2001 From: sun Date: Mon, 15 Sep 2025 21:39:18 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EB=AA=A8=EB=8B=AC=20=ED=8F=AC=ED=83=88?= =?UTF-8?q?=EB=A1=9C=20=EB=A7=8C=EB=93=A4=EA=B8=B0,=20=EC=B9=B4=EB=93=9C?= =?UTF-8?q?=20=EC=A0=9C=EB=AA=A9=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.tsx | 1 + src/app/not-found.tsx | 2 +- src/components/card/Card.tsx | 4 +- src/components/modal/Modal.tsx | 47 +++++++++++++++---- .../modal/cardModal/DetailCardModal.tsx | 30 +++++++----- 5 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7cdf282..621c410 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -23,6 +23,7 @@ export default function RootLayout({ children }: { children: React.ReactNode }) disableTransitionOnChange storageKey="taskify-theme" > +
{children} diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index c37a5af..17aadd5 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -16,7 +16,7 @@ export default function NotFound() { return ( <> -
+

앗, 접근할 수 없는 페이지입니다 diff --git a/src/components/card/Card.tsx b/src/components/card/Card.tsx index daa0474..b42b835 100644 --- a/src/components/card/Card.tsx +++ b/src/components/card/Card.tsx @@ -73,7 +73,9 @@ export default function Card({
{/* 제목 */} -

{title}

+

+ {title} +

(null); + useEffect(() => { + if (typeof window !== "undefined") { + setPortal(document.getElementById("portal")); + } + }, []); + useEffect(() => { if (open) { document.body.style.overflow = "hidden"; @@ -40,7 +47,9 @@ function Modal({ open, children, size = "lg", isOpenModal, className }: ModalPro } as const )[size] ?? "min-w-[584px] max-w-lg"; - return ( + if (!portal) return null; + + return createPortal( {open && ( )} - + , + portal, ); } @@ -79,17 +89,36 @@ type ModalHeaderProps = { onClose?: () => void; className?: string; titleStyle?: string; + extraBtn?: React.ReactNode; + btnStyle?: string; }; -function ModalHeader({ title, children, onClose, className, titleStyle }: ModalHeaderProps) { +function ModalHeader({ + title, + children, + onClose, + className, + titleStyle, + btnStyle, + extraBtn, +}: ModalHeaderProps) { return (

{title}

{children} - {onClose && ( - - )} +
+ {extraBtn} + {onClose && ( + + )} +
); } diff --git a/src/components/modal/cardModal/DetailCardModal.tsx b/src/components/modal/cardModal/DetailCardModal.tsx index c1bf5ce..f18593e 100644 --- a/src/components/modal/cardModal/DetailCardModal.tsx +++ b/src/components/modal/cardModal/DetailCardModal.tsx @@ -147,17 +147,25 @@ export default function DetailCardModal({ isOpen, setIsOpen, setColumns }: Modal setIsOpen(false)} - className="tablet:items-center items-start justify-start" - titleStyle="pt-12 tablet:pt-0" - > - - + className="tablet:h-8 h-[70px]" + titleStyle="overflow-hidden text-ellipsis pc:w-[500px] tablet:w-[480px] self-end tablet:self-center" + btnStyle="self-start tablet:self-center" + extraBtn={ + + } + >