Skip to content

Commit

Permalink
Use Links component to manipulate anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Nov 10, 2023
1 parent 7ba8acd commit 4c49d0a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/map-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { useTranslations } from 'next-intl';

Expand All @@ -22,39 +23,39 @@ export default function MapMenu() {
)}
>
<li className="lg:hidden">
<a
<Link
className={cn(
'flex h-full items-center rounded-sm px-3 py-1.5 text-center text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
// hash === '#search' && 'bg-accent text-accent-foreground',
)}
href="#search"
>
{t('search')}
</a>
</Link>
</li>
{hasContent && (
<li>
<a
<Link
className={cn(
'flex h-full items-center rounded-sm px-3 py-1.5 text-center text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
// hash === '#content' && 'bg-accent text-accent-foreground',
)}
href="#content"
>
{contentLabel}
</a>
</Link>
</li>
)}
<li>
<a
<Link
className={cn(
'flex h-full items-center rounded-sm px-3 py-1.5 text-center text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
// hash === '#map' && 'bg-accent text-accent-foreground',
)}
href={`#map`}
href="#map"
>
{t('map')}
</a>
</Link>
</li>
</ul>
</nav>
Expand Down

0 comments on commit 4c49d0a

Please sign in to comment.