mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:49:45 +00:00
При переходе на проект оказываемся сверху стр
This commit is contained in:
1 parent
1a0d4072ea
commit
aaec846fc8
1 file changed
+9
-3
@@ -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() {
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content={`СКБ, ${post.title || ""}, ${
|
||||
post.categories?.join(", ") || ""
|
||||
}, ИКТИБ, ЮФУ`}
|
||||
content={`СКБ, ${post.title || ""}, ${post.categories?.join(", ") || ""
|
||||
}, ИКТИБ, ЮФУ`}
|
||||
/>
|
||||
<meta name="robots" content="index,follow" />
|
||||
</Helmet>
|
||||
|
||||
Reference in new issue
Block a user