feat: implement Portal component and refactor modals to use it for improved positioning
This commit is contained in:
@@ -17,6 +17,7 @@ import type { ApiResponse, PaginatedResponse } from '../lib/api';
|
||||
import type { Clinic } from '../types';
|
||||
import { useAuthStore } from '../stores/authStore';
|
||||
import MobileInput from '../components/ui/MobileInput';
|
||||
import Portal from '../components/ui/Portal';
|
||||
import { formatDate, formatNumber, iranMobileSchema } from '../lib/utils';
|
||||
import Pagination from '../components/ui/Pagination';
|
||||
import ConfirmDialog from '../components/ui/ConfirmDialog';
|
||||
@@ -244,6 +245,7 @@ export default function ClinicsPage() {
|
||||
|
||||
{/* Add Modal */}
|
||||
{addOpen && (
|
||||
<Portal>
|
||||
<div className="overlay" onClick={() => setAddOpen(false)}>
|
||||
<div className="modal" style={{ maxWidth: 420 }} onClick={(e) => e.stopPropagation()}>
|
||||
<div className="modal-head">
|
||||
@@ -287,6 +289,7 @@ export default function ClinicsPage() {
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</Portal>
|
||||
)}
|
||||
|
||||
<ConfirmDialog
|
||||
|
||||
Reference in New Issue
Block a user