feat: enable portal rendering for ImageCropModal component

This commit is contained in:
hamed
2026-07-04 21:55:14 +03:30
parent 6ade17a5b4
commit ae1e40aeee
+4 -2
View File
@@ -1,4 +1,5 @@
import { useCallback, useState } from 'react';
import { createPortal } from 'react-dom';
import Cropper, { type Area } from 'react-easy-crop';
import { getCroppedImage } from '../lib/cropImage';
@@ -28,7 +29,7 @@ export default function ImageCropModal({ src, fileName, onCancel, onConfirm }: I
}
};
return (
return createPortal(
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4" dir="rtl">
<div className="w-full max-w-md rounded-2xl bg-white dark:bg-gray-900 shadow-2xl overflow-hidden">
<div className="flex items-center justify-between px-5 py-4 border-b border-slate-100 dark:border-gray-800">
@@ -70,6 +71,7 @@ export default function ImageCropModal({ src, fileName, onCancel, onConfirm }: I
</div>
</div>
</div>
</div>
</div>,
document.body,
);
}