diff --git a/frontend/src/app/[locale]/Header.tsx b/frontend/src/app/[locale]/Header.tsx
index e8e366b..22b8e30 100644
--- a/frontend/src/app/[locale]/Header.tsx
+++ b/frontend/src/app/[locale]/Header.tsx
@@ -3,7 +3,7 @@ import {
NavbarContent,
NavbarBrand,
NavbarItem,
- Link as NextUiLink
+ Link as NextUiLink,
} from "@nextui-org/react";
import { useTranslations } from "next-intl";
import { siteConfig } from "@/config/site";
@@ -35,20 +35,7 @@ export default function Header(params: { locale: string }) {
Test Case Manager
-
- {siteConfig.navItems.map((item) => (
-
-
- {item.label}
-
-
- ))}
-
- {/* {siteConfig.navItems.map((item) => (
+ {siteConfig.navItems.map((item) => (
- ))} */}
+ ))}
diff --git a/frontend/src/app/[locale]/LangSwitch.tsx b/frontend/src/app/[locale]/LangSwitch.tsx
index 8cde304..68932c1 100644
--- a/frontend/src/app/[locale]/LangSwitch.tsx
+++ b/frontend/src/app/[locale]/LangSwitch.tsx
@@ -6,7 +6,8 @@ import {
DropdownMenu,
DropdownItem,
} from "@nextui-org/react";
-import { Globe } from "lucide-react";
+import { Globe, ChevronDown } from "lucide-react";
+import { usePathname } from "next/navigation";
import { useRouter } from "@/src/navigation";
const locales = [
@@ -16,15 +17,29 @@ const locales = [
export default function LangSwitch(params: { locale: string }) {
const router = useRouter();
+ const pathname = usePathname();
- async function changeLocale(locale: string) {
- router.push("/", { locale: locale });
+ async function changeLocale(nextLocale: string) {
+ let newPathname;
+ if (params.locale.length < 4) {
+ // when root path
+ router.push("/", { locale: nextLocale });
+ } else {
+ // when not root path, trim first "/en" from pathname = "/en/projects"
+ newPathname = pathname.slice(params.locale.length + 1);
+ router.push(newPathname, { locale: nextLocale });
+ }
}
return (
- }>
+ }
+ endContent={}
+ >
{locales.find((locale) => locale.code === params.locale)?.name ||
params.locale}