fix: add logout button in mobile dropdown and name in desktop
This commit is contained in:
27
components/Current/Header/LoginButton.tsx
Normal file
27
components/Current/Header/LoginButton.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user