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:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user