При переходе на проект оказываемся сверху стр

This commit is contained in:
xomimishka committed 2025-07-05 00:46:00 +03:00
1 parent 1a0d4072ea
commit aaec846fc8
1 file changed
+8 -2
+8 -2
View File
@@ -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,8 +73,7 @@ function WpPostPage() {
/>
<meta
name="keywords"
content={`СКБ, ${post.title || ""}, ${
post.categories?.join(", ") || ""
content={`СКБ, ${post.title || ""}, ${post.categories?.join(", ") || ""
}, ИКТИБ, ЮФУ`}
/>
<meta name="robots" content="index,follow" />