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);
|
background: hsla(0, 0%, 100%, 0.1);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.add-account-form {
|
/* El formulario de añadir cuenta sale en bloque, debajo del nombre. */
|
||||||
display: inline;
|
.add-account-box {
|
||||||
|
display: block;
|
||||||
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
.add-account-input {
|
.add-account-input {
|
||||||
min-width: 150px;
|
min-width: 150px;
|
||||||
}
|
}
|
||||||
|
.add-account-msg {
|
||||||
|
display: block;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Colores de clase de WoW (nombre de personaje) */
|
/* Colores de clase de WoW (nombre de personaje) */
|
||||||
.class-warrior { color: #c79c6e; }
|
.class-warrior { color: #c79c6e; }
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ export function GameAccountSwitcher({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addAccount(e: React.FormEvent) {
|
async function addAccount() {
|
||||||
e.preventDefault()
|
|
||||||
if (busy || !password) return
|
if (busy || !password) return
|
||||||
setBusy(true)
|
setBusy(true)
|
||||||
setError(null)
|
setError(null)
|
||||||
@@ -97,20 +96,22 @@ export function GameAccountSwitcher({
|
|||||||
+
|
+
|
||||||
</button>
|
</button>
|
||||||
{adding && (
|
{adding && (
|
||||||
<form onSubmit={addAccount} className="add-account-form" autoComplete="off">
|
<span className="add-account-box">
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
maxLength={16}
|
maxLength={16}
|
||||||
placeholder={t('addAccountPassword')}
|
placeholder={t('addAccountPassword')}
|
||||||
value={password}
|
value={password}
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
|
onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault(); addAccount() } }}
|
||||||
className="account-select add-account-input"
|
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')}
|
{busy ? '…' : t('addAccountConfirm')}
|
||||||
</button>
|
</button>
|
||||||
{error && <span className="red-form-response"> {error}</span>}
|
{error && <span className="add-account-msg red-form-response">{error}</span>}
|
||||||
</form>
|
</span>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user