web-next: enlace REINO de la cabecera dinámico (/<slug>-realm)

El menú de la cabecera enlazaba a /novawow-realm fijo. Ahora Header (server)
calcula el slug desde realmlist (getRealmName + realmSlug) y lo pasa a
SiteHeader como realmHref → el enlace REINO apunta a /trinity-realm (o al
reino que haya). Acompaña a la ruta dinámica [realm].

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 12:41:44 +00:00
parent a9ae6d4506
commit cae1c224b0
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
import { getSession } from '@/lib/session'
import { getRealmName, realmSlug } from '@/lib/realm'
import { SiteHeader } from './SiteHeader'
export async function Header() {
@@ -6,6 +7,8 @@ export async function Header() {
const loggedIn = Boolean(session.username)
// Django muestra bnet_email si existe, si no el username.
const accountLabel = session.bnetEmail || session.username || ''
// Enlace al reino según el nombre en realmlist (p. ej. /trinity-realm).
const realmHref = `/${realmSlug(await getRealmName())}-realm`
return <SiteHeader loggedIn={loggedIn} accountLabel={accountLabel} />
return <SiteHeader loggedIn={loggedIn} accountLabel={accountLabel} realmHref={realmHref} />
}
+3 -1
View File
@@ -16,9 +16,11 @@ const SERVER_NAME = 'NovaWoW'
export function SiteHeader({
loggedIn,
accountLabel,
realmHref,
}: {
loggedIn: boolean
accountLabel: string
realmHref: string
}) {
const router = useRouter()
const [open, setOpen] = useState(false)
@@ -83,7 +85,7 @@ export function SiteHeader({
</a>
</p>
<p>
<a href="/novawow-realm">REINO</a>
<a href={realmHref}>REINO</a>
</p>
{loggedIn && (
<p>