X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fhome%2Fsignup.tsx;h=bb1e1f1142be867fd69c742914f90aa2b70d5ab6;hb=c3ab9e74f8775f4b811866d2675b00f9702bde3d;hp=7d504184f7fd2d5e9d366a295c5b55330c0813e8;hpb=94bc9092ee863a456c6f289e5c5a85472dfa5e5a;p=lemmy-ui.git diff --git a/src/shared/components/home/signup.tsx b/src/shared/components/home/signup.tsx index 7d50418..bb1e1f1 100644 --- a/src/shared/components/home/signup.tsx +++ b/src/shared/components/home/signup.tsx @@ -1,4 +1,6 @@ +import { myAuth, setIsoData } from "@utils/app"; import { isBrowser } from "@utils/browser"; +import { validEmail } from "@utils/helpers"; import { Options, passwordStrength } from "check-password-strength"; import { NoOptionI18nKeys } from "i18next"; import { Component, linkEvent } from "inferno"; @@ -10,17 +12,11 @@ import { LoginResponse, SiteView, } from "lemmy-js-client"; -import { i18n } from "../../i18next"; -import { UserService } from "../../services"; +import { joinLemmyUrl } from "../../config"; +import { mdToHtml } from "../../markdown"; +import { I18NextService, UserService } from "../../services"; import { HttpService, RequestState } from "../../services/HttpService"; -import { - joinLemmyUrl, - mdToHtml, - myAuth, - setIsoData, - toast, - validEmail, -} from "../../utils"; +import { toast } from "../../toast"; import { HtmlTags } from "../common/html-tags"; import { Icon, Spinner } from "../common/icon"; import { MarkdownTextArea } from "../common/markdown-textarea"; @@ -116,7 +112,7 @@ export class Signup extends Component { } titleName(siteView: SiteView): string { - return i18n.t( + return I18NextService.i18n.t( siteView.local_site.private_instance ? "apply_to_join" : "sign_up" ); } @@ -144,8 +140,11 @@ export class Signup extends Component { registerForm() { const siteView = this.state.siteRes.site_view; return ( -
-
{this.titleName(siteView)}
+ +

{this.titleName(siteView)}

{this.isLemmyMl && (
@@ -162,7 +161,7 @@ export class Signup extends Component { className="col-sm-2 col-form-label" htmlFor="register-username" > - {i18n.t("username")} + {I18NextService.i18n.t("username")}
@@ -175,14 +174,14 @@ export class Signup extends Component { required minLength={3} pattern="[a-zA-Z0-9_]+" - title={i18n.t("community_reqs")} + title={I18NextService.i18n.t("community_reqs")} />
{ className="form-control" placeholder={ siteView.local_site.require_email_verification - ? i18n.t("required") - : i18n.t("optional") + ? I18NextService.i18n.t("required") + : I18NextService.i18n.t("optional") } value={this.state.form.email} autoComplete="email" @@ -205,7 +204,7 @@ export class Signup extends Component { !validEmail(this.state.form.email) && (
- {i18n.t("no_password_reset")} + {I18NextService.i18n.t("no_password_reset")}
)}
@@ -216,7 +215,7 @@ export class Signup extends Component { className="col-sm-2 col-form-label" htmlFor="register-password" > - {i18n.t("password")} + {I18NextService.i18n.t("password")}
{ /> {this.state.form.password && (
- {i18n.t(this.passwordStrength as NoOptionI18nKeys)} + {I18NextService.i18n.t( + this.passwordStrength as NoOptionI18nKeys + )}
)}
@@ -243,7 +244,7 @@ export class Signup extends Component { className="col-sm-2 col-form-label" htmlFor="register-verify-password" > - {i18n.t("verify_password")} + {I18NextService.i18n.t("verify_password")}
{
- {i18n.t("fill_out_application")} + {I18NextService.i18n.t("fill_out_application")}
{siteView.local_site.application_question && (
{ className="col-sm-2 col-form-label" htmlFor="application_answer" > - {i18n.t("answer")} + {I18NextService.i18n.t("answer")}
{ onChange={linkEvent(this, this.handleRegisterShowNsfwChange)} />
@@ -348,12 +349,14 @@ export class Signup extends Component { return (