From 7f47f6db4846c81e739779ff38cd3de59ae49db5 Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Fri, 26 Sep 2025 17:26:59 -0700 Subject: [PATCH] feat: scroll to top button --- .../navigation/scrollToTop/ScrollToTop.tsx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/webapp/components/navigation/scrollToTop/ScrollToTop.tsx diff --git a/src/webapp/components/navigation/scrollToTop/ScrollToTop.tsx b/src/webapp/components/navigation/scrollToTop/ScrollToTop.tsx new file mode 100644 index 00000000..e1e88ab4 --- /dev/null +++ b/src/webapp/components/navigation/scrollToTop/ScrollToTop.tsx @@ -0,0 +1,31 @@ +'use client'; + +import { useWindowScroll } from '@mantine/hooks'; +import { ActionIcon, Transition } from '@mantine/core'; +import { FaArrowUp } from 'react-icons/fa6'; + +export default function ScrollToTop() { + const [scroll, scrollTo] = useWindowScroll(); + + return ( + 100}> + {(transitionStyles) => ( + scrollTo({ y: 0 })} + style={{ ...transitionStyles, zIndex: 102 }} + radius={'xl'} + variant="outline" + size={'xl'} + bg="white" + color={'gray'} + m="sm" + pos={'fixed'} + bottom={0} + left={0} + > + + + )} + + ); +} -- 2.51.2