(fix:modals) use portals

This commit is contained in:
ManishMadan2882
2025-05-16 16:15:02 +05:30
parent fc4942e189
commit 96c7daf818
2 changed files with 5 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ export default function ActionButtons({
};
return (
<div className="absolute right-4 top-4 z-20">
<div className="fixed right-4 top-4 z-10">
<div className={`flex items-center gap-2 sm:gap-4 ${className}`}>
{showNewChat && (
<button

View File

@@ -1,4 +1,5 @@
import React, { useEffect, useRef } from 'react';
import { createPortal } from 'react-dom';
import Exit from '../assets/exit.svg';
@@ -45,7 +46,7 @@ export default function WrapperModal({
};
}, [close]);
return (
const modalContent = (
<div className="fixed left-0 top-0 z-30 flex h-screen w-screen items-center justify-center bg-gray-alpha bg-opacity-50">
<div
ref={modalRef}
@@ -63,4 +64,6 @@ export default function WrapperModal({
</div>
</div>
);
return createPortal(modalContent, document.body);
}