X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fcommunity%2Fcommunity-form.tsx;h=e44675c91c608256aad56729ef91fb0de0f118cf;hb=9f2289d46600385354d3673b0ef2ba921a1fbe49;hp=ab19da82c87216d813e57e30ea5c1408f7f6bfae;hpb=91ab497e95ce12ad9ab154fa1d35e83f570ece71;p=lemmy-ui.git diff --git a/src/shared/components/community/community-form.tsx b/src/shared/components/community/community-form.tsx index ab19da8..e44675c 100644 --- a/src/shared/components/community/community-form.tsx +++ b/src/shared/components/community/community-form.tsx @@ -1,18 +1,18 @@ import { myAuthRequired } from "@utils/app"; import { capitalizeFirstLetter, randomStr } from "@utils/helpers"; import { Component, linkEvent } from "inferno"; +import { Prompt } from "inferno-router"; import { CommunityView, CreateCommunity, EditCommunity, Language, } from "lemmy-js-client"; -import { i18n } from "../../i18next"; +import { I18NextService } from "../../services"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; import { LanguageSelect } from "../common/language-select"; import { MarkdownTextArea } from "../common/markdown-textarea"; -import NavigationPrompt from "../common/navigation-prompt"; interface CommunityFormProps { community_view?: CommunityView; // If a community is given, that means this is an edit @@ -90,7 +90,8 @@ export class CommunityForm extends Component< className="community-form" onSubmit={linkEvent(this, this.handleCreateCommunitySubmit)} > - - {i18n.t("name")} + {I18NextService.i18n.t("name")} @@ -125,7 +126,7 @@ export class CommunityForm extends Component< required minLength={3} pattern="[a-z0-9_]+" - title={i18n.t("community_reqs")} + title={I18NextService.i18n.t("community_reqs")} /> @@ -135,10 +136,10 @@ export class CommunityForm extends Component< className="col-12 col-sm-2 col-form-label" htmlFor="community-title" > - {i18n.t("display_name")} + {I18NextService.i18n.t("display_name")} @@ -158,11 +159,11 @@ export class CommunityForm extends Component<
- {i18n.t("nsfw")} + {I18NextService.i18n.t("nsfw")}
@@ -219,7 +220,7 @@ export class CommunityForm extends Component< )}
- {i18n.t("only_mods_can_post_in_community")} + {I18NextService.i18n.t("only_mods_can_post_in_community")}
@@ -230,7 +231,7 @@ export class CommunityForm extends Component< checked={this.state.form.posting_restricted_to_mods} onChange={linkEvent( this, - this.handleCommunityPostingRestrictedToMods + this.handleCommunityPostingRestrictedToMods, )} />
@@ -254,9 +255,9 @@ export class CommunityForm extends Component< {this.props.loading ? ( ) : this.props.community_view ? ( - capitalizeFirstLetter(i18n.t("save")) + capitalizeFirstLetter(I18NextService.i18n.t("save")) ) : ( - capitalizeFirstLetter(i18n.t("create")) + capitalizeFirstLetter(I18NextService.i18n.t("create")) )} {this.props.community_view && ( @@ -265,7 +266,7 @@ export class CommunityForm extends Component< className="btn btn-secondary" onClick={linkEvent(this, this.handleCancel)} > - {i18n.t("cancel")} + {I18NextService.i18n.t("cancel")} )}
@@ -329,7 +330,7 @@ export class CommunityForm extends Component< handleCommunityPostingRestrictedToMods(i: CommunityForm, event: any) { i.setState( - s => ((s.form.posting_restricted_to_mods = event.target.checked), s) + s => ((s.form.posting_restricted_to_mods = event.target.checked), s), ); }