From aaec846fc8933d42f8daf1edca20f807a9fe7704 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Sat, 5 Jul 2025 00:46:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=B5=20=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=20=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=D1=81=D1=8F=20=D1=81=D0=B2=D0=B5=D1=80=D1=85=D1=83?= =?UTF-8?q?=20=D1=81=D1=82=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/WpPostPage/WpPostPage.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pages/WpPostPage/WpPostPage.tsx b/src/pages/WpPostPage/WpPostPage.tsx index 219aca4..858dab3 100644 --- a/src/pages/WpPostPage/WpPostPage.tsx +++ b/src/pages/WpPostPage/WpPostPage.tsx @@ -4,6 +4,7 @@ import { useParams } from "react-router-dom"; import { ProjectsList } from "@/widgets/CardList/CardList"; import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost"; import { Helmet } from "react-helmet"; +import { useEffect } from "react"; function WpPostPage() { const params = useParams(); @@ -11,6 +12,12 @@ function WpPostPage() { const { data: post, isLoading, isError } = usePostById(postId || -1); + useEffect(() => { + if (post) { + window.scrollTo({ top: 0, behavior: "auto" }); + } + }, [post]); + if (!postId) { return ( <> @@ -66,9 +73,8 @@ function WpPostPage() { />