mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Fix scrolling bug in content pages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { FC } from 'react';
|
||||
import { FC, useEffect } from 'react';
|
||||
import { getPortfolioPorjectsSlugs, getPortfolioProjectdata } from '../../lib/portfolio';
|
||||
import { useRouter } from 'next/router';
|
||||
import { MdxRemote } from 'next-mdx-remote/types';
|
||||
@@ -101,6 +101,10 @@ const PortfolioProject: FC<Props> = ({ source, frontMatter }) => {
|
||||
const content = hydrate(source, { components });
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
||||
Reference in New Issue
Block a user