This commit is contained in:
Timothy Armes
2024-10-21 15:19:28 +02:00
parent 4181b92670
commit 91f4d30c7e
3 changed files with 39 additions and 44 deletions
+4 -7
View File
@@ -1,11 +1,8 @@
"use client";
import { useState } from "react";
import { Button, Menu } from "@headlessui/react";
import { signIn, signOut, useSession } from "next-auth/react";
import { MenuButton } from "@headlessui/react";
import { signIn, useSession } from "next-auth/react";
import { useTranslations } from "next-intl";
import { useRouter } from "next/navigation";
import { RxAvatar } from "react-icons/rx";
import { useAuthMenuOptions } from "@/hooks/useAuthMenuOptions";
@@ -27,9 +24,9 @@ const AuthButton = () => {
items={menuItems}
containerClassName="flex items-center justify-center"
buttonComponent={
<Menu.Button>
<MenuButton>
<RxAvatar className="h-6 w-6" />
</Menu.Button>
</MenuButton>
}
/>
);
+1 -1
View File
@@ -37,7 +37,7 @@ export const LocaleChecker = ({ children }: LocaleCheckerProps) => {
) {
router.push({ pathname, params: params as any }, { locale: userLocale });
}
}, [locale, sessionData, status]);
}, [locale, sessionData, status, params, pathname, router, userLocale]);
// To avoid flickering, we don't render the children until we have the user's locale
if (status === "loading") return null;