diff options
author | Dessalines <tyhou13@gmx.com> | 2020-02-02 14:37:19 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-02-02 14:37:19 -0500 |
commit | caba049da12017f22a8ffa8d6b8e7f0a2cc20e6a (patch) | |
tree | 5c53177858098e4d4414896bba53f90f0ceddd78 /ui/src/components/login.tsx | |
parent | 96a7e99e57f8c79eead599e6de5d94016f7021e6 (diff) | |
parent | 6124133e8517165a97aa87af5485857a000951a2 (diff) |
Merge branch 'dev' into websocket_scopes
Diffstat (limited to 'ui/src/components/login.tsx')
-rw-r--r-- | ui/src/components/login.tsx | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx index b65b7a83..581c4995 100644 --- a/ui/src/components/login.tsx +++ b/ui/src/components/login.tsx @@ -13,7 +13,6 @@ import { import { WebSocketService, UserService } from '../services'; import { wsJsonToRes, validEmail, toast } from '../utils'; import { i18n } from '../i18next'; -import { T } from 'inferno-i18next'; interface State { loginForm: LoginForm; @@ -78,15 +77,19 @@ export class Login extends Component<any, State> { return ( <div> <form onSubmit={linkEvent(this, this.handleLoginSubmit)}> - <h5>Login</h5> + <h5>{i18n.t('login')}</h5> <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" + htmlFor="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 +98,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" htmlFor="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 +115,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 +139,17 @@ export class Login extends Component<any, State> { registerForm() { return ( <form onSubmit={linkEvent(this, this.handleRegisterSubmit)}> - <h5> - <T i18nKey="sign_up">#</T> - </h5> + <h5>{i18n.t('sign_up')}</h5> + <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" htmlFor="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" htmlFor="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" htmlFor="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,18 @@ 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" + htmlFor="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" @@ -204,12 +218,13 @@ export class Login extends Component<any, State> { <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" htmlFor="register-show-nsfw"> + {i18n.t('show_nsfw')} </label> </div> </div> |