Skip to content

Commit

Permalink
Merge branch 'Akshatchaube01:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MastanSayyad authored Jul 16, 2024
2 parents f640cbe + f0d314a commit 5ddee60
Showing 1 changed file with 7 additions and 26 deletions.
33 changes: 7 additions & 26 deletions src/components/BottomToTop.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState, useEffect } from "react";
import styled from "styled-components";
import { FaArrowUp } from "react-icons/fa";

const GoToTop = () => {
Expand All @@ -25,34 +24,16 @@ const GoToTop = () => {
return (
<>
{isVisible && (
<Wrapper onClick={goToTop}>
<FaArrowUp className="top-btn--icon" />
</Wrapper>
<div
onClick={goToTop}
className="flex justify-center items-center fixed bottom-20 right-5 w-12 h-12 bg-blue-500 text-white rounded-full cursor-pointer transition-transform transform hover:bg-blue-700 hover:-translate-y-1"
>
<FaArrowUp className="text-lg" />
</div>
)}
</>
);
};

const Wrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
position: fixed;
bottom: 17px;
right: 10px;
color: white;
background-color: rgb(59 130 246);
width: 48px;
height: 48px;
z-index: 9999;
border-radius: 50%;
cursor: pointer;
transition: transform 0.3s ease, background-color 0.3s ease;
&:hover {
background-color: #003a79;
transform: translateY(-5px);
}
`;

export default GoToTop;

0 comments on commit 5ddee60

Please sign in to comment.