diff --git a/client/src/components/CatModal.tsx b/client/src/components/CatModal.tsx index 59cf368..36b2216 100644 --- a/client/src/components/CatModal.tsx +++ b/client/src/components/CatModal.tsx @@ -1,4 +1,5 @@ import { useEffect, useState, useRef } from 'react'; +import { createPortal } from 'react-dom'; import { Link } from 'react-router-dom'; import { useCat, useDeleteCat } from '@/hooks/useCats'; import { useLikeStatus, useLikeCat, useUnlikeCat } from '@/hooks/useLikes'; @@ -83,13 +84,14 @@ export default function CatModal({ catId, onClose }: CatModalProps) { }; if (isLoading || !cat) { - return ( + return createPortal(
Загрузка...
-
+
, + document.body ); } @@ -97,7 +99,7 @@ export default function CatModal({ catId, onClose }: CatModalProps) { year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit', }); - return ( + return createPortal(
-
+ , + document.body ); } \ No newline at end of file