Add locale to PageHeader links
- Convert PageHeader to client component to use useLocale hook
- Update home logo link to include locale: /${locale}/home
- Update account icon link to include locale: /${locale}/home/account/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,22 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { SelectLanguage } from "./SelectLanguage";
|
import { SelectLanguage } from "./SelectLanguage";
|
||||||
import AccountCircle from "@mui/icons-material/AccountCircle";
|
import AccountCircle from "@mui/icons-material/AccountCircle";
|
||||||
|
import { useLocale } from "next-intl";
|
||||||
|
|
||||||
export const PageHeader = () =>
|
export const PageHeader = () => {
|
||||||
|
const locale = useLocale();
|
||||||
|
|
||||||
|
return (
|
||||||
<div className="navbar bg-base-100 mb-6">
|
<div className="navbar bg-base-100 mb-6">
|
||||||
<Link className="btn btn-ghost text-xl" href="/home"><Image src="/icon3.png" alt="logo" width={48} height={48} /> Režije</Link>
|
<Link className="btn btn-ghost text-xl" href={`/${locale}/home`}><Image src="/icon3.png" alt="logo" width={48} height={48} /> Režije</Link>
|
||||||
<span className="grow"> </span>
|
<span className="grow"> </span>
|
||||||
<SelectLanguage />
|
<SelectLanguage />
|
||||||
<Link href="/home/account/" className="btn btn-ghost btn-circle">
|
<Link href={`/${locale}/home/account/`} className="btn btn-ghost btn-circle">
|
||||||
<AccountCircle />
|
<AccountCircle />
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user