diff --git a/web-next/app/[locale]/account/page.tsx b/web-next/app/[locale]/account/page.tsx index cd34cec..0c8b73d 100644 --- a/web-next/app/[locale]/account/page.tsx +++ b/web-next/app/[locale]/account/page.tsx @@ -46,11 +46,6 @@ export default async function AccountPage({ params }: { params: Promise<{ locale return ( - {/* Selector de cuenta de juego (WOW1/WOW2…) si la bnet tiene más de una */} - {games.length > 1 && ( - - )} - {/* Información: dos fieldsets como en Django */}
@@ -60,7 +55,11 @@ export default async function AccountPage({ params }: { params: Promise<{ locale
{t('basicData')}
-

{t('accountName')}: {wowAccountName(data.gameAccount)}

+

{t('accountName')}:{' '} + {games.length > 1 + ? + : {wowAccountName(data.gameAccount)}} +

{t('regMail')}: {maskEmail(data.regMail)}

{t('currentMail')}: {maskEmail(data.email)}

{t('joindate')}: {data.joindate}

diff --git a/web-next/app/globals.css b/web-next/app/globals.css index 0e9ee56..70be254 100644 --- a/web-next/app/globals.css +++ b/web-next/app/globals.css @@ -359,6 +359,17 @@ textarea:focus { color: #b1997f; } +/* Selector de cuenta inline (dentro de «Nombre de la cuenta»). */ +.account-select { + width: auto; + min-width: 92px; + height: auto; + padding: 2px 8px; + margin: 0 0 0 4px; + font-size: 17px; + vertical-align: middle; +} + /* Colores de clase de WoW (nombre de personaje) */ .class-warrior { color: #c79c6e; } .class-paladin { color: #f58cba; } diff --git a/web-next/components/GameAccountSwitcher.tsx b/web-next/components/GameAccountSwitcher.tsx index b3ac667..c7888c2 100644 --- a/web-next/components/GameAccountSwitcher.tsx +++ b/web-next/components/GameAccountSwitcher.tsx @@ -1,14 +1,14 @@ 'use client' import { useState } from 'react' -import { useTranslations } from 'next-intl' -import { useRouter } from '@/i18n/navigation' /** - * Desplegable para cambiar la cuenta de juego activa (WOW1, WOW2…) cuando la - * Battle.net tiene más de una. Al cambiar, fija la cuenta en la sesión - * (/api/auth/select-account) y refresca → todo /account (datos, personajes, - * servicios, compras…) pasa a operar sobre la cuenta seleccionada. + * Desplegable INLINE para cambiar la cuenta de juego activa (WOW1, WOW2…), + * mostrado en el campo «Nombre de la cuenta» cuando la Battle.net tiene más de + * una. Al cambiar, fija la cuenta en la sesión (/api/auth/select-account) y + * hace una RECARGA COMPLETA (no router.refresh) → todo /account (datos, + * personajes, servicios, compras…) pasa a operar sobre la cuenta elegida y se + * recargan bien todos los estilos/iconos. */ export function GameAccountSwitcher({ accounts, @@ -17,8 +17,6 @@ export function GameAccountSwitcher({ accounts: { id: number; index: number }[] currentId: number }) { - const t = useTranslations('Account') - const router = useRouter() const [busy, setBusy] = useState(false) async function onChange(e: React.ChangeEvent) { @@ -33,7 +31,7 @@ export function GameAccountSwitcher({ body: JSON.stringify({ accountId: id }), }) const d = await res.json() - if (d.success) router.refresh() + if (d.success) window.location.reload() else setBusy(false) } catch { setBusy(false) @@ -41,19 +39,12 @@ export function GameAccountSwitcher({ } return ( -
-
-

- {t('switchAccountLabel')}{' '} - -

-
-
+ ) }