mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:39:45 +00:00
При переходе на проект оказываемся сверху стр
This commit is contained in:
1 parent
1a0d4072ea
commit
aaec846fc8
1 file changed
+8
-2
@@ -4,6 +4,7 @@ import { useParams } from "react-router-dom";
|
|||||||
import { ProjectsList } from "@/widgets/CardList/CardList";
|
import { ProjectsList } from "@/widgets/CardList/CardList";
|
||||||
import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost";
|
import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost";
|
||||||
import { Helmet } from "react-helmet";
|
import { Helmet } from "react-helmet";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
function WpPostPage() {
|
function WpPostPage() {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
@@ -11,6 +12,12 @@ function WpPostPage() {
|
|||||||
|
|
||||||
const { data: post, isLoading, isError } = usePostById(postId || -1);
|
const { data: post, isLoading, isError } = usePostById(postId || -1);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (post) {
|
||||||
|
window.scrollTo({ top: 0, behavior: "auto" });
|
||||||
|
}
|
||||||
|
}, [post]);
|
||||||
|
|
||||||
if (!postId) {
|
if (!postId) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -66,8 +73,7 @@ function WpPostPage() {
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="keywords"
|
name="keywords"
|
||||||
content={`СКБ, ${post.title || ""}, ${
|
content={`СКБ, ${post.title || ""}, ${post.categories?.join(", ") || ""
|
||||||
post.categories?.join(", ") || ""
|
|
||||||
}, ИКТИБ, ЮФУ`}
|
}, ИКТИБ, ЮФУ`}
|
||||||
/>
|
/>
|
||||||
<meta name="robots" content="index,follow" />
|
<meta name="robots" content="index,follow" />
|
||||||
|
|||||||
Reference in new issue
Block a user