diff --git a/apps/web/src/components/profileDropdown.tsx b/apps/web/src/components/profileDropdown.tsx index ceefef87..6d35f202 100644 --- a/apps/web/src/components/profileDropdown.tsx +++ b/apps/web/src/components/profileDropdown.tsx @@ -18,31 +18,9 @@ export function ProfileDropdown() { const { user } = useAuth(); const buttonRef = useRef(null); const dropdownRef = useRef(null); - const timeoutDuration = 200; - let timeoutId: ReturnType; if (!user) return null; - const openMenu = () => buttonRef?.current?.click(); - const closeMenu = () => - dropdownRef?.current?.dispatchEvent( - new KeyboardEvent("keydown", { - key: "Escape", - bubbles: true, - cancelable: true, - }), - ); - - const onMouseEnter = (closed?: boolean) => { - if (timeoutId) clearTimeout(timeoutId); - if (closed) openMenu(); - }; - const onMouseLeave = (open: boolean) => { - if (open) { - timeoutId = setTimeout(() => closeMenu(), timeoutDuration); - } - }; - return ( {({ open }) => ( @@ -55,14 +33,11 @@ export function ProfileDropdown() { ? "rounded-b-none rounded-t bg-slate-800 text-white" : "text-muted rounded", )} - onClick={openMenu} as={Link} href={`/users/${user.username}`} - onMouseEnter={() => onMouseEnter(!open)} - onMouseLeave={() => onMouseLeave(open)} > Open user menu -
+
@@ -77,8 +52,6 @@ export function ProfileDropdown() { > onMouseEnter()} - onMouseLeave={() => onMouseLeave(open)} static className="absolute right-0 z-40 mt-0 w-48 origin-top-right divide-y divide-slate-700" >