Cuenta: panel de servicios (enlaces a todas las páginas)

La página de cuenta solo mostraba datos y personajes, sin acceso a los servicios.
Añade un panel con 4 grupos:
- Servicios de personaje: renombrar, personalizar, cambiar raza/facción, subir nivel,
  comprar oro, transferir.
- Utilidades: revivir, desatascar, token de seguridad.
- Ajustes de cuenta: cambiar contraseña, cambiar email.
- Comunidad: votar, reclutar, tienda (Battlepay).
i18n es/en en el namespace Account.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 01:35:39 +00:00
parent f721aac7e5
commit 95df2e029d
3 changed files with 102 additions and 3 deletions
+62 -1
View File
@@ -1,5 +1,5 @@
import { getTranslations, setRequestLocale } from 'next-intl/server'
import { redirect } from '@/i18n/navigation'
import { redirect, Link } from '@/i18n/navigation'
import { getSession } from '@/lib/session'
import { getAccountDashboard } from '@/lib/account'
import { LogoutButton } from '@/components/LogoutButton'
@@ -85,6 +85,67 @@ export default async function AccountPage({ params }: { params: Promise<{ locale
</div>
)}
</section>
<ServicesPanel t={t} />
</main>
)
}
function ServicesPanel({ t }: { t: (k: string) => string }) {
const groups: { title: string; items: { href: string; label: string }[] }[] = [
{
title: t('servicesTitle'),
items: [
{ href: '/rename', label: t('svcRename') },
{ href: '/customize', label: t('svcCustomize') },
{ href: '/change-race', label: t('svcChangeRace') },
{ href: '/change-faction', label: t('svcChangeFaction') },
{ href: '/level-up', label: t('svcLevelUp') },
{ href: '/gold', label: t('svcGold') },
{ href: '/transfer', label: t('svcTransfer') },
],
},
{
title: t('utilitiesTitle'),
items: [
{ href: '/revive', label: t('svcRevive') },
{ href: '/unstuck', label: t('svcUnstuck') },
{ href: '/security-token', label: t('svcToken') },
],
},
{
title: t('accountSettings'),
items: [
{ href: '/change-password', label: t('svcChangePassword') },
{ href: '/change-email', label: t('svcChangeEmail') },
],
},
{
title: t('communityTitle'),
items: [
{ href: '/vote-points', label: t('svcVote') },
{ href: '/recruit', label: t('svcRecruit') },
{ href: '/battlepay', label: t('svcStore') },
],
},
]
return (
<div className="mt-8 grid gap-4 sm:grid-cols-2">
{groups.map((g) => (
<section key={g.title} className="nw-card">
<h2 className="mb-3 text-lg font-semibold text-nw-gold-light">{g.title}</h2>
<ul className="space-y-1.5 text-sm">
{g.items.map((it) => (
<li key={it.href}>
<Link href={it.href} className="text-sky-400 hover:text-amber-300 hover:underline">
{it.label}
</Link>
</li>
))}
</ul>
</section>
))}
</div>
)
}
+20 -1
View File
@@ -61,7 +61,26 @@
"notRequested": "Not requested",
"characters": "My characters",
"level": "Level",
"noCharacters": "You have no characters yet."
"noCharacters": "You have no characters yet.",
"servicesTitle": "Character services",
"utilitiesTitle": "Utilities",
"accountSettings": "Account settings",
"communityTitle": "Community",
"svcRename": "Rename character",
"svcCustomize": "Customize appearance",
"svcChangeRace": "Change race",
"svcChangeFaction": "Change faction",
"svcLevelUp": "Level up",
"svcGold": "Buy gold",
"svcTransfer": "Transfer character",
"svcRevive": "Revive character",
"svcUnstuck": "Unstuck character",
"svcToken": "Security token",
"svcChangePassword": "Change password",
"svcChangeEmail": "Change email",
"svcVote": "Vote (points)",
"svcRecruit": "Recruit a friend",
"svcStore": "Store (Battlepay)"
},
"SelectAccount": {
"title": "Select your game account",
+20 -1
View File
@@ -61,7 +61,26 @@
"notRequested": "Sin solicitar",
"characters": "Mis personajes",
"level": "Nivel",
"noCharacters": "No tienes personajes todavía."
"noCharacters": "No tienes personajes todavía.",
"servicesTitle": "Servicios de personaje",
"utilitiesTitle": "Utilidades",
"accountSettings": "Ajustes de cuenta",
"communityTitle": "Comunidad",
"svcRename": "Renombrar personaje",
"svcCustomize": "Personalizar aspecto",
"svcChangeRace": "Cambiar raza",
"svcChangeFaction": "Cambiar facción",
"svcLevelUp": "Subir de nivel",
"svcGold": "Comprar oro",
"svcTransfer": "Transferir personaje",
"svcRevive": "Revivir personaje",
"svcUnstuck": "Desatascar personaje",
"svcToken": "Token de seguridad",
"svcChangePassword": "Cambiar contraseña",
"svcChangeEmail": "Cambiar email",
"svcVote": "Votar (puntos)",
"svcRecruit": "Recluta a un amigo",
"svcStore": "Tienda (Battlepay)"
},
"SelectAccount": {
"title": "Selecciona tu cuenta de juego",