web-next: usar el nombre del reino (realmlist) en menú, estado y título
- Menú de navegación: el desplegable «NovaWoW» ahora muestra el nombre del reino de realmlist (Header pasa realmName a SiteHeader). - Home: el título «NovaWoW WOTLK 3.4.3» y el nombre del recuadro de estado (antes home_serverselection.name) usan el nombre del reino de realmlist. Ahora el reino es «Trinity». El logo (alt) y el texto de intro se mantienen como marca. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
import { ServerClock } from '@/components/ServerClock'
|
||||
import { getNoticias, getServerStatus, type Noticia, type ServerStatus } from '@/lib/home'
|
||||
import { getRealmName } from '@/lib/realm'
|
||||
|
||||
const SERVER_NAME = 'NovaWoW'
|
||||
|
||||
@@ -30,6 +31,7 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const { noticias, status } = await getData()
|
||||
const realmName = await getRealmName()
|
||||
|
||||
const worldStatus = status ? status.world_status : 'Offline'
|
||||
const worldClass = worldStatus === 'Online' ? 'green-info' : 'red-info'
|
||||
@@ -41,7 +43,7 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s
|
||||
<div className="middle-content middle-content-index">
|
||||
<div className="body-content">
|
||||
<div className="title-content">
|
||||
<h1>{SERVER_NAME} WOTLK 3.4.3</h1>
|
||||
<h1>{realmName} WOTLK 3.4.3</h1>
|
||||
</div>
|
||||
<div className="box-content">
|
||||
<div className="raf-index-holder">
|
||||
@@ -52,7 +54,7 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="yellow-info">
|
||||
{status?.server_name ?? '—'}{' '}
|
||||
{realmName}{' '}
|
||||
<span className="blue-info small-font">{status?.expansion ?? ''}</span>
|
||||
</td>
|
||||
<td className={`real-info-box ${worldClass}`}>{worldStatus}</td>
|
||||
|
||||
@@ -7,10 +7,19 @@ 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 || ''
|
||||
// Enlaces al reino/jugadores según el nombre en realmlist (p. ej. /trinity-realm, /trinity-players).
|
||||
const slug = realmSlug(await getRealmName())
|
||||
// Nombre y enlaces del reino según realmlist (p. ej. Trinity → /trinity-realm, /trinity-players).
|
||||
const realmName = await getRealmName()
|
||||
const slug = realmSlug(realmName)
|
||||
const realmHref = `/${slug}-realm`
|
||||
const playersHref = `/${slug}-players`
|
||||
|
||||
return <SiteHeader loggedIn={loggedIn} accountLabel={accountLabel} realmHref={realmHref} playersHref={playersHref} />
|
||||
return (
|
||||
<SiteHeader
|
||||
loggedIn={loggedIn}
|
||||
accountLabel={accountLabel}
|
||||
realmName={realmName}
|
||||
realmHref={realmHref}
|
||||
playersHref={playersHref}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -16,11 +16,13 @@ const SERVER_NAME = 'NovaWoW'
|
||||
export function SiteHeader({
|
||||
loggedIn,
|
||||
accountLabel,
|
||||
realmName,
|
||||
realmHref,
|
||||
playersHref,
|
||||
}: {
|
||||
loggedIn: boolean
|
||||
accountLabel: string
|
||||
realmName: string
|
||||
realmHref: string
|
||||
playersHref: string
|
||||
}) {
|
||||
@@ -74,7 +76,7 @@ export function SiteHeader({
|
||||
|
||||
<div className="nav-dropdown">
|
||||
<div className="nav-dropdown-btn">
|
||||
{SERVER_NAME} <i className="fas fa-caret-down"></i>
|
||||
{realmName} <i className="fas fa-caret-down"></i>
|
||||
</div>
|
||||
<div className="nav-dropdown-content">
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user