diff --git a/components/about/ToApp.tsx b/components/about/ToApp.tsx index ac8badb..9373f63 100644 --- a/components/about/ToApp.tsx +++ b/components/about/ToApp.tsx @@ -1,21 +1,44 @@ +import { useState, useEffect } from "react"; + export default function ToApp() { + const [showButton, setShowButton] = useState(true); + + useEffect(() => { + const handleScroll = () => { + if (window.scrollY < 2) { + setShowButton(true); + } else { + setShowButton(false); + } + }; + + window.addEventListener("scroll", handleScroll); + return () => window.removeEventListener("scroll", handleScroll); + }, []); + return ( <> - {/* */} - + + {showButton && ( +