More app directory refactoring

This commit is contained in:
Darren Clarke 2023-06-28 09:09:45 +00:00 committed by GitHub
parent b312a8c862
commit 8bbeaa25cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 903 additions and 899 deletions

View file

@ -1,6 +1,6 @@
"use client";
import { useRouter } from "next/router";
import { useRouter } from "next/navigation";
import { IconButton, Menu, MenuItem, Box } from "@mui/material";
import { KeyboardArrowDown as KeyboardArrowDownIcon } from "@mui/icons-material";
import {
@ -17,6 +17,7 @@ export const LanguageSelect = () => {
} = useAppContext();
const router = useRouter();
const locales: any = { en: "English", fr: "Français" };
const locale = "en";
const popupState = usePopupState({ variant: "popover", popupId: "language" });
return (
@ -38,7 +39,7 @@ export const LanguageSelect = () => {
},
}}
>
{locales[router.locale as any] ?? locales.en}
{locales[locale as any] ?? locales.en}
<KeyboardArrowDownIcon />
</IconButton>
<Menu {...bindMenu(popupState)}>
@ -46,7 +47,7 @@ export const LanguageSelect = () => {
<MenuItem
key={locale}
onClick={() => {
router.push(router.route, router.route, { locale });
// router.push(router.route, router.route, { locale });
popupState.close();
}}
>