diff --git a/src/components/BackToTop.tsx b/src/components/BackToTop.tsx index e11bf6a..2560cf8 100644 --- a/src/components/BackToTop.tsx +++ b/src/components/BackToTop.tsx @@ -1,9 +1,10 @@ "use client"; +import React from "react"; import { useEffect, useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; -const BackToTop = (): JSX.Element | null => { +const BackToTop = ():React.ReactElement | null => { const [isVisible, setIsVisible] = useState(false); useEffect(() => { @@ -16,10 +17,7 @@ const BackToTop = (): JSX.Element | null => { }; window.addEventListener("scroll", toggleVisibility); - - return () => { - window.removeEventListener("scroll", toggleVisibility); - }; + return () => window.removeEventListener("scroll", toggleVisibility); }, []); const scrollToTop = (): void => { @@ -32,20 +30,25 @@ const BackToTop = (): JSX.Element | null => { return ( {isVisible && ( - - ↑ - +
+ + + ↑ + +
)}
); }; -export default BackToTop; +export default BackToTop; \ No newline at end of file