fix: add logout button in mobile dropdown and name in desktop

This commit is contained in:
Christel Westerberg
2024-06-12 16:51:06 +02:00
parent 8e176d3a06
commit 386b107bd8
8 changed files with 95 additions and 30 deletions

View File

@@ -0,0 +1,27 @@
"use client"
import { usePathname } from "next/navigation"
import { useIntl } from "react-intl"
import { login } from "@/constants/routes/handleAuth"
import Link from "@/components/TempDesignSystem/Link"
import { LangParams } from "@/types/params"
export default function LoginButton({
className,
lang,
}: LangParams & { className: string }) {
const { formatMessage } = useIntl()
const pathName = usePathname()
return (
<Link
href={`${login[lang]}?redirectTo=${encodeURIComponent(`/${lang}${pathName}`)}`}
className={className}
>
{formatMessage({ id: "Log in" })}
</Link>
)
}