diff --git a/.gitignore b/.gitignore index 74206d9..e8eaae9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. TODO diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/echecsfrance.iml b/.idea/echecsfrance.iml new file mode 100644 index 0000000..478db44 --- /dev/null +++ b/.idea/echecsfrance.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e8c917d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TODO b/TODO deleted file mode 100644 index a0902d1..0000000 --- a/TODO +++ /dev/null @@ -1,18 +0,0 @@ -BUGS -//TODO tournament page load is weird on 2nd click. On safari it pauses for a few seconds. Is it trying to load the entire page before displaying? -//TODO Nodemailer 'from' reverts to echecsfrance@gmail.com - quick fix done with sender address in subject line - ----------------------------------------------------------------- -DESIGN CHANGES -//TODO font size on mobile screen -//TODO mobile navbar is creeping into the page by a few pixels when hidden - move it to the right a bit. It is easier to see in light mode. I cant see this on Linux -//TODO logo for navbar and favicon -//TODO mobile map needs improving - ----------------------------------------------------------------- -LOGIC -//TODO error handling - check everything, wrap in try/catch or use library to handle, log errors - -MISC ----------------------------------------------------------------- -//TODO move smaller ui components into a new folder, and make them reusable - such as using generic prop names diff --git a/app/[lang]/tournois/ScrollToTopButton.tsx b/app/[lang]/tournois/ScrollToTopButton.tsx index 321ac3b..f7d702d 100644 --- a/app/[lang]/tournois/ScrollToTopButton.tsx +++ b/app/[lang]/tournois/ScrollToTopButton.tsx @@ -5,21 +5,11 @@ import { ScrollableElement } from "@/types"; import { FaArrowUp } from "react-icons/fa"; import { handleScrollToTop } from "@/handlers/scrollHandlers"; import { useEffect, useRef, useState } from "react"; +import {useBreakpoint} from "@/hooks/tailwind"; const ScrollToTopButton = () => { const scrollToTopElementRef = useRef(null); - const [isLgScreen, setIsLgScreen] = useState(false); - - // calculate screen size - useEffect(() => { - const handleResize = () => { - setIsLgScreen(window.innerWidth >= 1024); - }; - handleResize(); - - window.addEventListener("resize", handleResize); - return () => window.removeEventListener("resize", handleResize); - }); + const isLgScreen = useBreakpoint("lg"); // determine scrollable element based on screen size - window or div useEffect(() => {