Skip to content

Commit

Permalink
Add function to go to top of new page when footer link is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelsoae committed Jan 4, 2024
1 parent be60d52 commit 7926740
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,26 @@ const Footer = () => {
</a>
</div>
<div className='footer__links'>
<Link to='/' className='footer__link'>Home</Link>
<Link to='/about' className='footer__link'>About</Link>
<Link to='/portfolio' className='footer__link'>Portfolio</Link>
<Link to='/contact' className='footer__link'>Contact</Link>
<Link
to='/'
className='footer__link'
onClick={() => {window.scroll(0, 0)}}
>Home</Link>
<Link
to='/about'
className='footer__link'
onClick={() => {window.scroll(0, 0)}}
>About</Link>
<Link
to='/portfolio'
className='footer__link'
onClick={() => {window.scroll(0, 0)}}
>Portfolio</Link>
<Link
to='/contact'
className='footer__link'
onClick={() => {window.scroll(0, 0)}}
>Contact</Link>
</div>
<img src={logoTransparent} alt='Rachel Soae Prather, Software Engineer' id='footer__logo' />
</section>
Expand Down

0 comments on commit 7926740

Please sign in to comment.