diff options
author | Richard <richard@tripaneer.com> | 2020-01-31 21:52:27 +0100 |
---|---|---|
committer | Richard <richard@tripaneer.com> | 2020-01-31 21:52:27 +0100 |
commit | 2f9a052f89fe8d34fedcd2219e644dd51cda5505 (patch) | |
tree | 78caf41816cce8fcc17a85d874a446a86da5e80b /ui/src/components/login.tsx | |
parent | 8cbdba1da39c15d2a3d13919398fc4d4c8ef2c6c (diff) |
usability features
This are all the commits from another PR combined into a single commit.
Diffstat (limited to 'ui/src/components/login.tsx')
-rw-r--r-- | ui/src/components/login.tsx | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx index 64687a3d..bea8564c 100644 --- a/ui/src/components/login.tsx +++ b/ui/src/components/login.tsx @@ -78,15 +78,16 @@ export class Login extends Component<any, State> { return ( <div> <form onSubmit={linkEvent(this, this.handleLoginSubmit)}> - <h5>Login</h5> + <h2>{ i18n.t('login') }</h2> <div class="form-group row"> - <label class="col-sm-2 col-form-label"> - <T i18nKey="email_or_username">#</T> + <label class="col-sm-2 col-form-label" for="login-email-or-username"> + { i18n.t('email_or_username') } </label> <div class="col-sm-10"> <input type="text" class="form-control" + id="login-email-or-username" value={this.state.loginForm.username_or_email} onInput={linkEvent(this, this.handleLoginUsernameChange)} required @@ -95,12 +96,13 @@ export class Login extends Component<any, State> { </div> </div> <div class="form-group row"> - <label class="col-sm-2 col-form-label"> - <T i18nKey="password">#</T> + <label class="col-sm-2 col-form-label" for="login-password"> + { i18n.t('password') } </label> <div class="col-sm-10"> <input type="password" + id="login-password" value={this.state.loginForm.password} onInput={linkEvent(this, this.handleLoginPasswordChange)} class="form-control" @@ -111,7 +113,7 @@ export class Login extends Component<any, State> { onClick={linkEvent(this, this.handlePasswordReset)} className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold" > - <T i18nKey="forgot_password">#</T> + { i18n.t('forgot_password') } </button> </div> </div> @@ -135,16 +137,19 @@ export class Login extends Component<any, State> { registerForm() { return ( <form onSubmit={linkEvent(this, this.handleRegisterSubmit)}> - <h5> - <T i18nKey="sign_up">#</T> - </h5> + <h2> + { i18n.t('sign_up') } + </h2> + <div class="form-group row"> - <label class="col-sm-2 col-form-label"> - <T i18nKey="username">#</T> + <label class="col-sm-2 col-form-label" for="register-username"> + { i18n.t('username') } </label> + <div class="col-sm-10"> <input type="text" + id="register-username" class="form-control" value={this.state.registerForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} @@ -155,13 +160,15 @@ export class Login extends Component<any, State> { /> </div> </div> + <div class="form-group row"> - <label class="col-sm-2 col-form-label"> - <T i18nKey="email">#</T> + <label class="col-sm-2 col-form-label" for="register-email"> + { i18n.t('email') } </label> <div class="col-sm-10"> <input type="email" + id="register-email" class="form-control" placeholder={i18n.t('optional')} value={this.state.registerForm.email} @@ -170,13 +177,15 @@ export class Login extends Component<any, State> { /> </div> </div> + <div class="form-group row"> - <label class="col-sm-2 col-form-label"> - <T i18nKey="password">#</T> + <label class="col-sm-2 col-form-label" for="register-password"> + { i18n.t('password') } </label> <div class="col-sm-10"> <input type="password" + id="register-password" value={this.state.registerForm.password} onInput={linkEvent(this, this.handleRegisterPasswordChange)} class="form-control" @@ -184,13 +193,15 @@ export class Login extends Component<any, State> { /> </div> </div> + <div class="form-group row"> - <label class="col-sm-2 col-form-label"> - <T i18nKey="verify_password">#</T> + <label class="col-sm-2 col-form-label" for="register-verify-password"> + { i18n.t('verify_password') } </label> <div class="col-sm-10"> <input type="password" + id="register-verify-password" value={this.state.registerForm.password_verify} onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)} class="form-control" @@ -198,18 +209,20 @@ export class Login extends Component<any, State> { /> </div> </div> - {this.state.enable_nsfw && ( + + { this.state.enable_nsfw && ( <div class="form-group row"> <div class="col-sm-10"> <div class="form-check"> <input class="form-check-input" + id="register-show-nsfw" type="checkbox" checked={this.state.registerForm.show_nsfw} onChange={linkEvent(this, this.handleRegisterShowNsfwChange)} /> - <label class="form-check-label"> - <T i18nKey="show_nsfw">#</T> + <label class="form-check-label" for="register-show-nsfw"> + { i18n.t('show_nsfw') } </label> </div> </div> |