- )}
- <input
- tabIndex={-1}
- autoComplete="false"
- name="a_password"
- type="text"
- class="form-control honeypot"
- id="register-honey"
- value={toUndefined(this.state.registerForm.honeypot)}
- onInput={linkEvent(this, this.handleHoneyPotChange)}
- />
- <div class="form-group row">
- <div class="col-sm-10">
- <button type="submit" class="btn btn-secondary">
- {this.state.registerLoading ? (
- <Spinner />
- ) : (
- this.titleName(siteView)
- )}
+ </div>
+ </div>
+ <input
+ tabIndex={-1}
+ autoComplete="false"
+ name="a_password"
+ type="text"
+ className="form-control honeypot"
+ id="register-honey"
+ value={this.state.form.honeypot}
+ onInput={linkEvent(this, this.handleHoneyPotChange)}
+ />
+ <div className="mb-3 row">
+ <div className="col-sm-10">
+ <button type="submit" className="btn btn-secondary">
+ {this.state.registerRes.state == "loading" ? (
+ <Spinner />
+ ) : (
+ this.titleName(siteView)
+ )}
+ </button>
+ </div>
+ </div>
+ </form>
+ );
+ }
+
+ renderCaptcha() {
+ switch (this.state.captchaRes.state) {
+ case "loading":
+ return <Spinner />;
+ case "success": {
+ const res = this.state.captchaRes.data;
+ return (
+ <div className="mb-3 row">
+ <label className="col-sm-2" htmlFor="register-captcha">
+ <span className="me-2">
+ {I18NextService.i18n.t("enter_code")}
+ </span>
+ <button
+ type="button"
+ className="btn btn-secondary"
+ onClick={linkEvent(this, this.handleRegenCaptcha)}
+ aria-label={I18NextService.i18n.t("captcha")}
+ >
+ <Icon icon="refresh-cw" classes="icon-refresh-cw" />