X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fperson%2Fpassword-change.tsx;h=1a60c968f72253d60234315744c1fa6da5b545fa;hb=b7ec7ae3110c560968e0cb24a32f1fe9166eec29;hp=3977feb41a47b6b285b06fb89324f031db97d28f;hpb=a07fc75972b3d7763a7122bbebd8924e4ac4344c;p=lemmy-ui.git diff --git a/src/shared/components/person/password-change.tsx b/src/shared/components/person/password-change.tsx index 3977feb..1a60c96 100644 --- a/src/shared/components/person/password-change.tsx +++ b/src/shared/components/person/password-change.tsx @@ -1,11 +1,12 @@ +import { myAuth, setIsoData } from "@utils/app"; +import { capitalizeFirstLetter } from "@utils/helpers"; import { Component, linkEvent } from "inferno"; import { GetSiteResponse, LoginResponse } from "lemmy-js-client"; -import { i18n } from "../../i18next"; -import { HttpService, UserService } from "../../services"; +import { HttpService, I18NextService, UserService } from "../../services"; import { RequestState } from "../../services/HttpService"; -import { capitalizeFirstLetter, myAuth, setIsoData } from "../../utils"; import { HtmlTags } from "../common/html-tags"; import { Spinner } from "../common/icon"; +import PasswordInput from "../common/password-input"; interface State { passwordChangeRes: RequestState; @@ -33,7 +34,7 @@ export class PasswordChange extends Component { } get documentTitle(): string { - return `${i18n.t("password_change")} - ${ + return `${I18NextService.i18n.t("password_change")} - ${ this.state.siteRes.site_view.site.name }`; } @@ -47,7 +48,9 @@ export class PasswordChange extends Component { />
-
{i18n.t("password_change")}
+

+ {I18NextService.i18n.t("password_change")} +

{this.passwordChangeForm()}
@@ -58,37 +61,22 @@ export class PasswordChange extends Component { passwordChangeForm() { return (
-
- -
- -
+
+
-
- -
- -
+
+
@@ -96,7 +84,7 @@ export class PasswordChange extends Component { {this.state.passwordChangeRes.state == "loading" ? ( ) : ( - capitalizeFirstLetter(i18n.t("save")) + capitalizeFirstLetter(I18NextService.i18n.t("save")) )}
@@ -133,7 +121,9 @@ export class PasswordChange extends Component { if (i.state.passwordChangeRes.state === "success") { const data = i.state.passwordChangeRes.data; - UserService.Instance.login(data); + UserService.Instance.login({ + res: data, + }); const site = await HttpService.client.getSite({ auth: myAuth() }); if (site.state === "success") {