From eea0fd716a00f83b9c669b751e66d203d44c75f1 Mon Sep 17 00:00:00 2001 From: HeagBoKaT Date: Fri, 29 May 2026 15:30:53 +0300 Subject: [PATCH] Fix modal: simple flex center, remove body position hacks --- client/src/components/CatModal.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/client/src/components/CatModal.tsx b/client/src/components/CatModal.tsx index a5b170c..59cf368 100644 --- a/client/src/components/CatModal.tsx +++ b/client/src/components/CatModal.tsx @@ -34,18 +34,8 @@ export default function CatModal({ catId, onClose }: CatModalProps) { useEffect(() => { if (likeData) setLiked(likeData.liked); }, [likeData]); useEffect(() => { if (data?.cat) setLikeCount(data.cat.likes_count); }, [data]); useEffect(() => { - const scrollY = window.scrollY; - document.documentElement.style.overflow = 'hidden'; - document.documentElement.style.height = '100%'; document.body.style.overflow = 'hidden'; - document.body.style.height = '100%'; - return () => { - document.documentElement.style.overflow = ''; - document.documentElement.style.height = ''; - document.body.style.overflow = ''; - document.body.style.height = ''; - window.scrollTo(0, scrollY); - }; + return () => { document.body.style.overflow = ''; }; }, []); useEffect(() => { const h = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; @@ -108,9 +98,9 @@ export default function CatModal({ catId, onClose }: CatModalProps) { }); return ( -
+
e.stopPropagation()} >