feat: implement Portal component and refactor modals to use it for improved positioning

This commit is contained in:
hamed
2026-07-04 22:05:27 +03:30
parent ae1e40aeee
commit f3ca6d844f
9 changed files with 168 additions and 9 deletions
@@ -7,6 +7,7 @@ import { toast } from 'sonner';
import { api } from '../../lib/api';
import type { ApiResponse } from '../../lib/api';
import MobileInput from './MobileInput';
import Portal from './Portal';
import { iranMobileSchema } from '../../lib/utils';
const inviteSchema = z.object({
@@ -39,6 +40,7 @@ export default function InviteDoctorModal({ clinicUuid, onClose, onInvited }: Pr
});
return (
<Portal>
<div className="overlay" onClick={onClose}>
<div className="modal" style={{ maxWidth: 420 }} onClick={e => e.stopPropagation()}>
<div className="modal-head">
@@ -71,5 +73,6 @@ export default function InviteDoctorModal({ clinicUuid, onClose, onInvited }: Pr
</form>
</div>
</div>
</Portal>
);
}