From b860b8155015864f9ca634e816e91e9d4449de08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Felipe=20Gon=C3=A7alves?= Date: Wed, 13 Mar 2024 19:38:50 +0000 Subject: [PATCH] feat(header): repaginate Header UI --- src/app/_components/header/index.tsx | 51 ++++------------------------ 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/src/app/_components/header/index.tsx b/src/app/_components/header/index.tsx index 057cbb32..824e52ce 100644 --- a/src/app/_components/header/index.tsx +++ b/src/app/_components/header/index.tsx @@ -1,6 +1,6 @@ 'use client' -import React, { useEffect, useState } from 'react' +import React from 'react' import Link from 'next/link' import { usePathname } from 'next/navigation' @@ -25,62 +25,25 @@ const MenuItem: React.FC<{ name: string; path: string }> = ({ name, path }) => { } export function Header() { - const [scrollPosition, setScrollPosition] = useState(0) - const [maxScrollValue, setMaxScrollValue] = useState(0) - - function handleScroll() { - if (window) { - setScrollPosition(window.scrollY) - } - if (document) { - setMaxScrollValue( - document.documentElement.scrollHeight - - document.documentElement.clientHeight - ) - } - } - - useEffect(() => { - handleScroll() - - if (window) { - window.addEventListener('scroll', handleScroll, { passive: true }) - } - - return () => { - window.removeEventListener('scroll', handleScroll) - } - }, []) - - const percentScrollPosition = Math.round( - (scrollPosition / maxScrollValue) * 100 - ) - return ( -
-
-
+
+
Mateus F. -
-