add reducedMotion check, center menu items

This commit is contained in:
premiare
2023-08-18 19:05:46 +10:00
parent 45d0d3f7e8
commit ad1ff6159c
3 changed files with 46 additions and 32 deletions

View File

@@ -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 (
<div className="flex md:hidden">
<Button variant="default" className="z-20 w-10 p-0" onClick={menuToggle}>