Files
NightSpire/web-next/app/[locale]/forum/user/[username]/page.tsx
T
Inna cc158d3819 web-next: migrar toda la UI al tema real nw-ryu
Reescritura completa del frontend Next.js del sistema visual Tailwind
"simulado" al tema Django original (nw-ryu), para paridad pixel con la
web actual antes del cutover.

- Tema real: copia de static/nw-themes/nw-ryu + favicons a public/, el
  layout carga el novavow-style.css real de ultimo (gana la cascada sobre
  Tailwind) + Font Awesome.
- Shell replicando los partials Django: SiteHeader, Video, Social, Footer,
  ServerClock; home con estructura real (main-page/middle-content/...).
- Helpers reutilizables: PageShell (main-page > middle-content > body-content
  > title-content) y ServiceBox (title-box-content + back-to-account).
- Paginas migradas a clases reales del tema (fieldset/tool-button/char-box/
  item-box/info-box-light/max-center-table/alert-message/botones reales),
  eliminando el markup Tailwind (.nw-btn/.nw-card/.nw-input):
  auth (login/register/recover/reset/select-account/activate),
  cuenta + servicios de personaje (revive/unstuck/rename/customize/
  change-race/change-faction/level-up/gold/transfer + pago Stripe),
  ajustes (change-password/change-email/security-token),
  comunidad (vote-points/recruit/battlepay), foro completo, y
  admin (indice + 7 secciones + los Admin*Manager).
- Se conserva el bilingue (next-intl); claves nuevas en messages/es|en.json.

Verificado: typecheck + build OK; rutas protegidas 307->login; sin
MISSING_MESSAGE; cero Tailwind residual (solo .nw-tool-btn/.nw-page,
clases propias en globals.css).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 09:54:58 +00:00

84 lines
2.7 KiB
TypeScript

import { getTranslations, setRequestLocale } from 'next-intl/server'
import { Link } from '@/i18n/navigation'
import { getForumProfile } from '@/lib/forum'
import { PageShell } from '@/components/PageShell'
export const dynamic = 'force-dynamic'
export default async function ForumProfilePage({
params,
}: {
params: Promise<{ locale: string; username: string }>
}) {
const { locale, username } = await params
setRequestLocale(locale)
const t = await getTranslations('Forum')
const p = await getForumProfile(decodeURIComponent(username))
const title = (
<>
{p.username}
{p.status && (
<span className="second-yellow small-font"> [{p.status === 'admin' ? t('roleAdmin') : t('roleGm')}]</span>
)}
</>
)
return (
<PageShell title={title}>
<div className="box-content">
<div className="body-box-content">
<p>
<Link href="/forum"> {t('backToForum')}</Link>
</p>
<br />
<table className="max-center-table info-box-light">
<tbody>
<tr>
<td className="centered separate">
<span className="second-brown">{t('posts')}</span>
<br />
<span className="yellow-info big-font">{p.postCount}</span>
</td>
<td className="centered separate">
<span className="second-brown">{t('topics')}</span>
<br />
<span className="yellow-info big-font">{p.topicCount}</span>
</td>
<td className="centered separate">
<span className="second-brown">{t('memberSince')}</span>
<br />
<span className="yellow-info">
{p.joindate ? new Date(p.joindate).toLocaleDateString(locale) : '—'}
</span>
</td>
</tr>
</tbody>
</table>
{p.recentTopics.length > 0 && (
<>
<div className="title-content-h3">
<h3 className="big-font">{t('recentTopics')}</h3>
</div>
<table className="max-center-table">
<tbody>
{p.recentTopics.map((topic) => (
<tr key={topic.id} className="team-center-table-tr">
<td className="lefted separate">
<Link href={`/forum/topic/${topic.id}`} className="yellow-info">
{topic.name}
</Link>
</td>
</tr>
))}
</tbody>
</table>
</>
)}
</div>
</div>
</PageShell>
)
}