Skip to content

Commit

Permalink
fixed scroll error
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBeesley committed May 28, 2023
1 parent 4cc21cb commit 3ee8c7d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Pages/ErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from "react";
import { useEffect } from 'react';
import Styles from "../Styles/main.module.scss";

function ErrorPage() {

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<div className={Styles.error}>
<p><i className="fa-solid fa-bug"></i> 404: Page not found</p>
Expand Down
6 changes: 6 additions & 0 deletions src/Pages/WebDev.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useEffect } from 'react';
import Style from '../Styles/pages.module.scss'
import Card from '../Components/card'
import CodeBox from '../Components/codebox'
Expand All @@ -13,6 +14,11 @@ export default function WebDev() {
'An introduction to React',
'Alternative Frameworks',
]

useEffect(() => {
window.scrollTo(0, 0)
}, [])

return (
<div>
<div className={Style.title}>
Expand Down
6 changes: 6 additions & 0 deletions src/Pages/devops.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useEffect } from 'react';
import Style from '../Styles/pages.module.scss'
import Card from '../Components/card'
import CodeBox from '../Components/codebox'
Expand All @@ -6,6 +7,11 @@ import img1 from '../Images/agile.png'

export default function DevOps() {
const titles = ['Overview', 'Agile Working', 'Azure']

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<div>
<div className={Style.title}>
Expand Down
6 changes: 6 additions & 0 deletions src/Pages/dotnet-and-csharp.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useEffect } from 'react';
import Style from '../Styles/pages.module.scss'
import Card from '../Components/card'
import CodeBox from '../Components/codebox'
Expand All @@ -20,6 +21,11 @@ export default function Dotnetandcsharp() {
'Adding Entity Framework Core',
'Extension Methods',
]

useEffect(() => {
window.scrollTo(0, 0);
}, []);

return (
<div>
<div className={Style.title}>
Expand Down

0 comments on commit 3ee8c7d

Please sign in to comment.