From ad1ff6159c655f04878f1d2da8742960f2e4fa0f Mon Sep 17 00:00:00 2001 From: premiare Date: Fri, 18 Aug 2023 19:05:46 +1000 Subject: [PATCH] add reducedMotion check, center menu items --- apps/marketing/package.json | 4 +- .../(marketing)/mobile-hamburger.tsx | 12 ++++ .../(marketing)/mobile-navigation.tsx | 62 ++++++++++--------- 3 files changed, 46 insertions(+), 32 deletions(-) diff --git a/apps/marketing/package.json b/apps/marketing/package.json index 469fe7e11..5e3014d26 100644 --- a/apps/marketing/package.json +++ b/apps/marketing/package.json @@ -4,7 +4,7 @@ "private": true, "license": "AGPL-3.0", "scripts": { - "dev": "PORT=3001 next dev", + "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" @@ -36,4 +36,4 @@ "@types/react": "18.2.18", "@types/react-dom": "18.2.7" } -} +} \ No newline at end of file diff --git a/apps/marketing/src/components/(marketing)/mobile-hamburger.tsx b/apps/marketing/src/components/(marketing)/mobile-hamburger.tsx index 071413502..0c23f6f1f 100644 --- a/apps/marketing/src/components/(marketing)/mobile-hamburger.tsx +++ b/apps/marketing/src/components/(marketing)/mobile-hamburger.tsx @@ -1,3 +1,7 @@ +'use client'; + +import { useEffect } from 'react'; + import { Menu, X } from 'lucide-react'; import { Button } from '@documenso/ui/primitives/button'; @@ -8,6 +12,14 @@ export interface HamburgerMenuProps { } export const HamburgerMenu = ({ isMenuOpen, menuToggle }: HamburgerMenuProps) => { + useEffect(() => { + // Update document.body.style.overflow based on the menu state + // and check that the window width is less than 768px + // if (window.innerWidth < 768) { + // document.body.style.overflow = isMenuOpen ? 'hidden' : 'auto'; + // } + }, [isMenuOpen]); + return (