diff --git a/src/components/Page/Page.js b/src/components/Page/Page.js index 4c6dd6f..d7ce8c0 100644 --- a/src/components/Page/Page.js +++ b/src/components/Page/Page.js @@ -1,15 +1,23 @@ -import React from 'react'; +import React, { useRef, useEffect } from 'react'; import styles from './Page.module.scss'; -const Page = ({ title, children }) => ( -
-
- { title &&

{title}

} -
- {children} +const Page = ({ title, children }) => { + const pageRef = useRef(); + + useEffect(() => { + pageRef.current.scrollIntoView(); + }); + + return ( +
+
+ { title &&

{title}

} +
+ {children} +
-
-); + ); +}; -export default Page; +export default Page; \ No newline at end of file