From 3179bcf866fc72496400c0b81afd9dfeb165d56f Mon Sep 17 00:00:00 2001 From: KishiTheMechanic Date: Thu, 17 Oct 2024 03:20:22 +0200 Subject: [PATCH] always show header when user on top --- website/solv-epics-dev/src/app/[locale]/layout.tsx | 6 +++++- website/solv-epics-dev/src/components/config/ModeToggle.tsx | 3 --- website/solv-epics-dev/src/hooks/utils/useShowHeader.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/website/solv-epics-dev/src/app/[locale]/layout.tsx b/website/solv-epics-dev/src/app/[locale]/layout.tsx index a5bde3c7..12046ed8 100644 --- a/website/solv-epics-dev/src/app/[locale]/layout.tsx +++ b/website/solv-epics-dev/src/app/[locale]/layout.tsx @@ -42,7 +42,11 @@ export default async function LocaleLayout({ className={cn(`${inter.variable} ${notoSansJP.variable}`)} suppressHydrationWarning > - + {children} diff --git a/website/solv-epics-dev/src/components/config/ModeToggle.tsx b/website/solv-epics-dev/src/components/config/ModeToggle.tsx index 507dfb67..f5e84d50 100644 --- a/website/solv-epics-dev/src/components/config/ModeToggle.tsx +++ b/website/solv-epics-dev/src/components/config/ModeToggle.tsx @@ -39,9 +39,6 @@ export function ModeToggle() { setTheme('dark')}> {t('common.darkMode')} - setTheme('system')}> - {t('common.systemMode')} - ) diff --git a/website/solv-epics-dev/src/hooks/utils/useShowHeader.tsx b/website/solv-epics-dev/src/hooks/utils/useShowHeader.tsx index 51642599..a1b77a66 100644 --- a/website/solv-epics-dev/src/hooks/utils/useShowHeader.tsx +++ b/website/solv-epics-dev/src/hooks/utils/useShowHeader.tsx @@ -14,7 +14,7 @@ export function useShowHeader({ defaultShowHeader = true }: Props = {}) { const handleScroll = () => { const currentScrollY = window.scrollY - if (currentScrollY < lastScrollY) { + if (currentScrollY < 80 || currentScrollY < lastScrollY) { setShowHeader(true) } else { setShowHeader(false)