X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fperson%2Fsettings.tsx;h=4caef458bbe84600baa0906672b36867bb92ca09;hb=c3ab9e74f8775f4b811866d2675b00f9702bde3d;hp=56d57a7a56850778c7e1a65923d36b4b38e2e0e9;hpb=d3a19751d5baa4b83d133bd8f78a00be3782335a;p=lemmy-ui.git diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index 56d57a7..4caef45 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -1,3 +1,20 @@ +import { + communityToChoice, + fetchCommunities, + fetchThemeList, + fetchUsers, + myAuth, + myAuthRequired, + personToChoice, + setIsoData, + setTheme, + showLocal, + updateCommunityBlock, + updatePersonBlock, +} from "@utils/app"; +import { capitalizeFirstLetter, debounce } from "@utils/helpers"; +import { Choice } from "@utils/types"; +import classNames from "classnames"; import { NoOptionI18nKeys } from "i18next"; import { Component, linkEvent } from "inferno"; import { @@ -11,32 +28,12 @@ import { PersonBlockView, SortType, } from "lemmy-js-client"; -import { i18n, languages } from "../../i18next"; +import { elementUrl, emDash, relTags } from "../../config"; import { UserService } from "../../services"; import { HttpService, RequestState } from "../../services/HttpService"; -import { - Choice, - capitalizeFirstLetter, - communityToChoice, - debounce, - elementUrl, - emDash, - enableNsfw, - fetchCommunities, - fetchThemeList, - fetchUsers, - myAuth, - myAuthRequired, - personToChoice, - relTags, - setIsoData, - setTheme, - setupTippy, - showLocal, - toast, - updateCommunityBlock, - updatePersonBlock, -} from "../../utils"; +import { I18NextService, languages } from "../../services/I18NextService"; +import { setupTippy } from "../../tippy"; +import { toast } from "../../toast"; import { HtmlTags } from "../common/html-tags"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; @@ -111,12 +108,12 @@ const Filter = ({ onChange: (choice: Choice) => void; loading: boolean; }) => ( -
+
{ } get documentTitle(): string { - return i18n.t("settings"); + return I18NextService.i18n.t("settings"); } render() { return ( -
+
{ tabs={[ { key: "settings", - label: i18n.t("settings"), + label: I18NextService.i18n.t("settings"), getNode: this.userSettings, }, { key: "blocks", - label: i18n.t("blocks"), + label: I18NextService.i18n.t("blocks"), getNode: this.blockCards, }, ]} @@ -266,34 +263,50 @@ export class Settings extends Component { ); } - userSettings() { + userSettings(isSelected) { return ( -
-
-
-
{this.saveUserSettingsHtmlForm()}
+
+
+
+
+
{this.saveUserSettingsHtmlForm()}
+
-
-
-
-
{this.changePasswordHtmlForm()}
+
+
+
{this.changePasswordHtmlForm()}
+
); } - blockCards() { + blockCards(isSelected) { return ( -
-
-
-
{this.blockUserCard()}
+
+
+
+
+
{this.blockUserCard()}
+
-
-
-
-
{this.blockCommunityCard()}
+
+
+
{this.blockCommunityCard()}
+
@@ -303,11 +316,11 @@ export class Settings extends Component { changePasswordHtmlForm() { return ( <> -
{i18n.t("change_password")}
+

{I18NextService.i18n.t("change_password")}

-
+
{ />
-
+
{ />
-
+
{ />
-
-
@@ -393,7 +409,7 @@ export class Settings extends Component { blockedUsersList() { return ( <> -
{i18n.t("blocked_users")}
+

{I18NextService.i18n.t("blocked_users")}

    {this.state.personBlocks.map(pb => (
  • @@ -405,7 +421,7 @@ export class Settings extends Component { { ctx: this, recipientId: pb.target.id }, this.handleUnblockPerson )} - data-tippy-content={i18n.t("unblock_user")} + data-tippy-content={I18NextService.i18n.t("unblock_user")} > @@ -437,7 +453,7 @@ export class Settings extends Component { blockedCommunitiesList() { return ( <> -
    {i18n.t("blocked_communities")}
    +

    {I18NextService.i18n.t("blocked_communities")}

      {this.state.communityBlocks.map(cb => (
    • @@ -449,7 +465,9 @@ export class Settings extends Component { { ctx: this, communityId: cb.community.id }, this.handleUnblockCommunity )} - data-tippy-content={i18n.t("unblock_community")} + data-tippy-content={I18NextService.i18n.t( + "unblock_community" + )} > @@ -466,18 +484,18 @@ export class Settings extends Component { return ( <> -
      {i18n.t("settings")}
      +

      {I18NextService.i18n.t("settings")}

      -
      -