From a3920224995826390bd3453095399befd26ce293 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sun, 12 May 2024 00:14:56 +0300 Subject: [PATCH] fix modals and publishers list filter zindex --- components/ConfirmationModal.tsx | 20 +++++++------- components/layout.tsx | 1 + components/publisher/PublisherSearchBox.js | 7 +++-- pages/cart/publishers/index.tsx | 32 ++++++++++++---------- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/components/ConfirmationModal.tsx b/components/ConfirmationModal.tsx index 1900155..ddf646b 100644 --- a/components/ConfirmationModal.tsx +++ b/components/ConfirmationModal.tsx @@ -1,29 +1,29 @@ import zIndex from "@mui/material/styles/zIndex"; +import ReactDOM from 'react-dom'; export default function ConfirmationModal({ isOpen, onClose, onConfirm, message }) { //export default function ConfirmationModal({ isOpen, onClose, onConfirm, message }) if (!isOpen) return null; - return ( -
+ const modalContent = ( +

{message}

- -
); + + return ReactDOM.createPortal( + modalContent, + document.getElementById('modal-root') + ); }; // const CustomCalendar = ({ month, year, shifts }) => { // export default function CustomCalendar({ date, shifts }: CustomCalendarProps) { \ No newline at end of file diff --git a/components/layout.tsx b/components/layout.tsx index 7c5639b..77f1073 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -63,6 +63,7 @@ export default function Layout({ children }) {
{children}
+ {/* Modal container */}
diff --git a/components/publisher/PublisherSearchBox.js b/components/publisher/PublisherSearchBox.js index 7ad9925..18085c7 100644 --- a/components/publisher/PublisherSearchBox.js +++ b/components/publisher/PublisherSearchBox.js @@ -127,7 +127,7 @@ function PublisherSearchBox({ id, selectedId, onChange, isFocused, filterDate, s ) : null} {showList ? ( // Display only clickable list of all publishers -