File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
44import Globe from "./assets/globe.inline.svg" ;
55import ChevronGrabberVertical from "./assets/chevron-grabber-vertical.inline.svg" ;
66import { languages } from "@workspace/i18n/config" ;
7- import { usePathname } from "@workspace/i18n/routing" ;
7+ import { Link , usePathname } from "@workspace/i18n/routing" ;
88import { useLocale } from "next-intl" ;
99import classNames from "classnames" ;
1010import { twMerge } from "tailwind-merge" ;
@@ -45,12 +45,13 @@ const LanguageSelector = ({ className = "" }) => {
4545 >
4646 { Object . keys ( languages ) . map ( ( language ) => (
4747 < DropdownMenu . Item asChild key = { language } >
48- < a
49- href = { "/" + language + asPath }
48+ < Link
49+ href = { asPath || "/" }
50+ locale = { language }
5051 className = "block px-2 py-1.5 rounded !no-underline text-base !text-[#848895] hover:!text-white hover:bg-[#151118] focus:bg-[#151118] outline-none light:!text-[#121212] light:hover:bg-neutral-100"
5152 >
5253 { languages [ language ] }
53- </ a >
54+ </ Link >
5455 </ DropdownMenu . Item >
5556 ) ) }
5657 </ DropdownMenu . Content >
You can’t perform that action at this time.
0 commit comments