Skip to content

Commit

Permalink
Revert "feat: dropdown on hover (#667)" (#668)
Browse files Browse the repository at this point in the history
This reverts commit 960d3a2.
  • Loading branch information
ankit01-oss authored Aug 22, 2024
1 parent 960d3a2 commit f5eebcd
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions components/TopNav/TopNav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { useEffect, useState, useRef } from 'react'
import { useEffect, useState } from 'react'
import { Button, Dialog, Popover } from '@headlessui/react'
import { Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline'
import Image from 'next/image'
Expand Down Expand Up @@ -64,22 +64,6 @@ export default function TopNav() {
}
}, [pathname])

const [isOpen, setIsOpen] = useState(false);
const timeoutRef = useRef<NodeJS.Timeout | null>(null);

const handleMouseEnter = () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
setIsOpen(true);
};

const handleMouseLeave = () => {
timeoutRef.current = setTimeout(() => {
setIsOpen(false);
}, 1);
};

return (
<div className="fixed left-0 right-0 z-30">

Expand Down Expand Up @@ -109,21 +93,10 @@ export default function TopNav() {
<span className="text-[17.111px] font-medium">SigNoz</span>
</Link>
<Popover.Group className="hidden items-center gap-x-6 lg:flex">
<div
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>

<Dropdown isOpen={isOpen}>
<Dropdown>
<DropdownTrigger>
<Button
className="truncate px-1.5 py-1 text-sm font-normal hover:text-signoz_robin-500"
onMouseEnter={() => {
setIsOpen(true);
}}
onMouseLeave={() => {
setIsOpen(false);
}}
>
<div className='flex items-center'>

Expand Down Expand Up @@ -219,7 +192,6 @@ export default function TopNav() {
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>

<Link
href="/docs"
Expand Down

0 comments on commit f5eebcd

Please sign in to comment.