Skip to content

Commit 9c291c4

Browse files
committed
smooth scroll added in footer
1 parent 3b9ab3e commit 9c291c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Footer/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React from 'react';
2+
import { animateScroll as scroll } from 'react-scroll';
23
import { FaFacebook, FaInstagram, FaYoutube, FaTwitter, FaLinkedin } from 'react-icons/fa';
34
import { FooterContainer, FooterWrapper, FooterLinksContainer, FooterLinksWrapper, FooterLinkItems, FooterLinkTitle, FooterLink, SocialMedia, SocialMediaWrapper, SocialLogo, WebsiteRights, SocialIcons, SocialIconLink } from './FooterElements';
45

56
const Footer = () => {
7+
const toggleHome = () => {
8+
scroll.scrollToTop();
9+
};
10+
611
return (
712
<FooterContainer>
813
<FooterWrapper>
@@ -52,7 +57,7 @@ const Footer = () => {
5257

5358
<SocialMedia>
5459
<SocialMediaWrapper>
55-
<SocialLogo to='/'>
60+
<SocialLogo to='/' onClick={toggleHome}>
5661
logo
5762
</SocialLogo>
5863
<WebsiteRights>logo © {new Date().getFullYear()} All rights reserved.</WebsiteRights>

0 commit comments

Comments
 (0)