From 7e6c3ea587fca7849866beb15a4f3d4a89f031e9 Mon Sep 17 00:00:00 2001 From: Isha-upadhyay Date: Sat, 17 Jan 2026 20:24:02 +0530 Subject: [PATCH 1/3] Fix modal overflow and improve responsiveness on small screens --- frontend/src/components/Modal.tsx | 152 +++++++++++++++++++++++++++--- 1 file changed, 137 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/Modal.tsx b/frontend/src/components/Modal.tsx index 9fafce81b5..2dda636c95 100644 --- a/frontend/src/components/Modal.tsx +++ b/frontend/src/components/Modal.tsx @@ -1,5 +1,11 @@ import { Button } from '@heroui/button' -import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter } from '@heroui/modal' +import { + Modal, + ModalContent, + ModalHeader, + ModalBody, + ModalFooter, +} from '@heroui/modal' import React from 'react' import { FaBolt } from 'react-icons/fa6' import type { ModalProps } from 'types/modal' @@ -17,43 +23,159 @@ const DialogComp: React.FC = ({ description, }: ModalProps) => { return ( - + - - {title} -

{description}

+ {/* ---------- HEADER ---------- */} + + + + {description && ( +

+ {description} +

+ )}
- -

Summary

- + + {/* ---------- BODY (SCROLLABLE) ---------- */} + +

Summary

+ + + {hint && ( -
-

+

+

How to tackle it

+
)} + {children} -
- + {/* ---------- DIVIDER ---------- */} +
+ + {/* ---------- FOOTER ---------- */} + {button.icon} {button.label} + From 1d115b3ec6c9d17001d79b28088e06c1f8a1197b Mon Sep 17 00:00:00 2001 From: Isha-upadhyay Date: Sat, 17 Jan 2026 22:20:01 +0530 Subject: [PATCH 2/3] coderabbit fixes --- frontend/src/components/Modal.tsx | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/Modal.tsx b/frontend/src/components/Modal.tsx index 2dda636c95..c0987c7157 100644 --- a/frontend/src/components/Modal.tsx +++ b/frontend/src/components/Modal.tsx @@ -21,16 +21,13 @@ const DialogComp: React.FC = ({ button, children, description, -}: ModalProps) => { +}) => { return ( = ({ w-[95vw] sm:w-full max-w-4xl - max-h-[100vh] - sm:max-h-[90vh] + max-h-[90vh] flex flex-col rounded-lg bg-white shadow-xl - backdrop-blur-xs + backdrop-blur-sm transition-all duration-300 ease-in-out @@ -57,7 +53,6 @@ const DialogComp: React.FC = ({ dark:bg-[#212529] " > - {/* ---------- HEADER ---------- */} {title} @@ -93,36 +88,36 @@ const DialogComp: React.FC = ({ )} - {/* ---------- BODY (SCROLLABLE) ---------- */}

Summary

{hint && (

- How to tackle it + + How to tackle it

)} @@ -130,10 +125,6 @@ const DialogComp: React.FC = ({ {children}
- {/* ---------- DIVIDER ---------- */} -
- - {/* ---------- FOOTER ---------- */} + - + {description && ( -

- {description} -

+

{description}

)}
@@ -93,13 +40,7 @@ const DialogComp: React.FC = ({ {hint && ( @@ -111,13 +52,7 @@ const DialogComp: React.FC = ({
)} @@ -125,22 +60,7 @@ const DialogComp: React.FC = ({ {children} - + {button.icon} {button.label} @@ -150,23 +70,7 @@ const DialogComp: React.FC = ({ variant="ghost" onPress={onClose} aria-label="close-modal" - className=" - rounded-md - bg-gray-600 - px-4 - py-1 - text-sm - font-medium - text-white - hover:bg-gray-700 - focus:outline-none - focus:ring-2 - focus:ring-gray-500 - focus:ring-offset-2 - dark:bg-gray-700 - dark:hover:bg-gray-600 - dark:focus:ring-gray-600 - " + className="rounded-md bg-gray-600 px-4 py-1 text-sm font-medium text-white hover:bg-gray-700 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 focus:outline-none dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-600" > Close