web-next: fix layout del formulario de añadir cuenta (mensaje abajo)
El <form> dentro del <p> «Nombre de la cuenta» era HTML inválido y el mensaje salía inline (en inglés «Wrong password» partía en «Add Wrong / Password»). Se quita el form: input+botón (onClick, Enter) en un span-bloque .add-account-box debajo del nombre, y el mensaje en .add-account-msg (display:block) en su propia línea. Igual en ES y EN. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -386,12 +386,18 @@ textarea:focus {
|
||||
background: hsla(0, 0%, 100%, 0.1);
|
||||
color: #fff;
|
||||
}
|
||||
.add-account-form {
|
||||
display: inline;
|
||||
/* El formulario de añadir cuenta sale en bloque, debajo del nombre. */
|
||||
.add-account-box {
|
||||
display: block;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.add-account-input {
|
||||
min-width: 150px;
|
||||
}
|
||||
.add-account-msg {
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Colores de clase de WoW (nombre de personaje) */
|
||||
.class-warrior { color: #c79c6e; }
|
||||
|
||||
@@ -43,8 +43,7 @@ export function GameAccountSwitcher({
|
||||
}
|
||||
}
|
||||
|
||||
async function addAccount(e: React.FormEvent) {
|
||||
e.preventDefault()
|
||||
async function addAccount() {
|
||||
if (busy || !password) return
|
||||
setBusy(true)
|
||||
setError(null)
|
||||
@@ -97,20 +96,22 @@ export function GameAccountSwitcher({
|
||||
+
|
||||
</button>
|
||||
{adding && (
|
||||
<form onSubmit={addAccount} className="add-account-form" autoComplete="off">
|
||||
<span className="add-account-box">
|
||||
<input
|
||||
type="password"
|
||||
maxLength={16}
|
||||
placeholder={t('addAccountPassword')}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault(); addAccount() } }}
|
||||
className="account-select add-account-input"
|
||||
autoComplete="off"
|
||||
/>
|
||||
<button type="submit" className="add-account-btn" disabled={busy}>
|
||||
<button type="button" className="add-account-btn" onClick={addAccount} disabled={busy}>
|
||||
{busy ? '…' : t('addAccountConfirm')}
|
||||
</button>
|
||||
{error && <span className="red-form-response"> {error}</span>}
|
||||
</form>
|
||||
{error && <span className="add-account-msg red-form-response">{error}</span>}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user