refactor(SubListContent.tsx): remoção de função

This commit is contained in:
Ana Carolina Duarte Cavalcante 2023-01-12 16:58:38 -03:00
parent b2b7f25ae8
commit 2ba6dabc4b

View File

@ -1,18 +1,7 @@
import { useEffect, useState } from "react";
import ArrowIcon from "./assets/icons/ArrowIcon.svg";
import WhatsAppIcon from "./assets/icons/WhatsAppIcon.svg";
const SubListContent = () => {
const [backToToButton, setBackToToButton] = useState(false);
useEffect(() => {
window.addEventListener("scroll", () => {
if (window.scrollY > 129) {
setBackToToButton(true);
} else {
setBackToToButton(false);
}
});
}, []);
const scrollUp = () => {
window.scrollTo({
top: 0,
@ -31,7 +20,6 @@ const SubListContent = () => {
</a>
</li>
<li>
{backToToButton && (
<button
style={{
background: "transparent",
@ -43,7 +31,6 @@ const SubListContent = () => {
>
<img src={ArrowIcon} alt="ir para o topo da página" />
</button>
)}
</li>
</>
);