From 93e3e1242af23b9975b7608c2686526880332b4d Mon Sep 17 00:00:00 2001 From: Timothy Armes Date: Wed, 25 Sep 2024 17:50:08 +0200 Subject: [PATCH] Remove scroll to top button --- src/app/[locale]/(main)/clubs/ClubTable.tsx | 3 -- .../(main)/tournaments/TournamentTable.tsx | 3 -- src/components/ScrollToTopButton.tsx | 38 ------------------- 3 files changed, 44 deletions(-) delete mode 100644 src/components/ScrollToTopButton.tsx diff --git a/src/app/[locale]/(main)/clubs/ClubTable.tsx b/src/app/[locale]/(main)/clubs/ClubTable.tsx index f68bb39..ac3cfd6 100644 --- a/src/app/[locale]/(main)/clubs/ClubTable.tsx +++ b/src/app/[locale]/(main)/clubs/ClubTable.tsx @@ -14,7 +14,6 @@ import { hoveredMapIdAtom, syncVisibleAtom, } from "@/atoms"; -import ScrollToTopButton from "@/components/ScrollToTopButton"; import SearchBar from "@/components/SearchBar"; import { useBreakpoint } from "@/hooks/tailwind"; @@ -60,8 +59,6 @@ const ClubTable = () => { - -
diff --git a/src/app/[locale]/(main)/tournaments/TournamentTable.tsx b/src/app/[locale]/(main)/tournaments/TournamentTable.tsx index 3ea45d4..6cc4475 100644 --- a/src/app/[locale]/(main)/tournaments/TournamentTable.tsx +++ b/src/app/[locale]/(main)/tournaments/TournamentTable.tsx @@ -20,7 +20,6 @@ import { normsOnlyAtom, syncVisibleAtom, } from "@/atoms"; -import ScrollToTopButton from "@/components/ScrollToTopButton"; import SearchBar from "@/components/SearchBar"; import { useBreakpoint } from "@/hooks/tailwind"; import useDatePickerWidth from "@/hooks/useDatePickerWidth"; @@ -120,8 +119,6 @@ const TournamentTable = () => { )} - -
diff --git a/src/components/ScrollToTopButton.tsx b/src/components/ScrollToTopButton.tsx deleted file mode 100644 index d48d1b3..0000000 --- a/src/components/ScrollToTopButton.tsx +++ /dev/null @@ -1,38 +0,0 @@ -"use client"; - -import { useEffect, useRef, useState } from "react"; - -import { FaArrowUp } from "react-icons/fa"; - -import { useBreakpoint } from "@/hooks/tailwind"; -import { ScrollableElement } from "@/types"; -import { handleScrollToTop } from "@/utils/scrollHandlers"; - -const ScrollToTopButton = () => { - const scrollToTopElementRef = useRef(null); - const isLgScreen = useBreakpoint("lg"); - - // determine scrollable element based on screen size - window or div - useEffect(() => { - isLgScreen - ? (scrollToTopElementRef.current = document.getElementById("listing")) - : (scrollToTopElementRef.current = window); - }, [isLgScreen]); - - const scrollToTopButtonClass = isLgScreen - ? "absolute bottom-0 right-3 p-10" - : "fixed bottom-20 right-3 py-10"; - - return ( - - ); -}; - -export default ScrollToTopButton;