From cae1c224b0132b2e4c6bce84db7b3d2f3c8efab2 Mon Sep 17 00:00:00 2001
From: adevopg
Date: Mon, 13 Jul 2026 12:41:44 +0000
Subject: [PATCH] =?UTF-8?q?web-next:=20enlace=20REINO=20de=20la=20cabecera?=
=?UTF-8?q?=20din=C3=A1mico=20(/-realm)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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)
---
web-next/components/Header.tsx | 5 ++++-
web-next/components/SiteHeader.tsx | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/web-next/components/Header.tsx b/web-next/components/Header.tsx
index 3eca0e6..e949803 100644
--- a/web-next/components/Header.tsx
+++ b/web-next/components/Header.tsx
@@ -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
+ return
}
diff --git a/web-next/components/SiteHeader.tsx b/web-next/components/SiteHeader.tsx
index 74e71f5..4939b88 100644
--- a/web-next/components/SiteHeader.tsx
+++ b/web-next/components/SiteHeader.tsx
@@ -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({
- REINO
+ REINO
{loggedIn && (