X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fcommunity%2Fcommunity-form.tsx;h=805e49638c457f0adf73759d85a3a6d82e711504;hb=afeb64009b1f5b44e831d35cc67c3c79e21292b7;hp=db7cff08a508e3644fd1a04aad75b50c8813bb6f;hpb=003b177f6e45ecbda6962a200d3ee10dff88c745;p=lemmy-ui.git diff --git a/src/shared/components/community/community-form.tsx b/src/shared/components/community/community-form.tsx index db7cff0..805e496 100644 --- a/src/shared/components/community/community-form.tsx +++ b/src/shared/components/community/community-form.tsx @@ -6,6 +6,7 @@ import { CommunityView, CreateCommunity, EditCommunity, + Language, toUndefined, UserOperation, wsJsonToRes, @@ -23,10 +24,14 @@ import { } from "../../utils"; 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"; interface CommunityFormProps { community_view: Option; // If a community is given, that means this is an edit + allLanguages: Language[]; + siteLanguages: number[]; + communityLanguages: Option; onCancel?(): any; onCreate?(community: CommunityView): any; onEdit?(community: CommunityView): any; @@ -50,6 +55,7 @@ export class CommunityForm extends Component< name: undefined, title: undefined, description: None, + discussion_languages: this.props.communityLanguages, nsfw: None, icon: None, banner: None, @@ -73,6 +79,9 @@ export class CommunityForm extends Component< this.handleBannerUpload = this.handleBannerUpload.bind(this); this.handleBannerRemove = this.handleBannerRemove.bind(this); + this.handleDiscussionLanguageChange = + this.handleDiscussionLanguageChange.bind(this); + this.parseMessage = this.parseMessage.bind(this); this.subscription = wsSubscribe(this.parseMessage); @@ -90,6 +99,7 @@ export class CommunityForm extends Component< posting_restricted_to_mods: Some( cv.community.posting_restricted_to_mods ), + discussion_languages: this.props.communityLanguages, auth: undefined, }), }; @@ -218,6 +228,7 @@ export class CommunityForm extends Component< maxLength={None} onContentChange={this.handleCommunityDescriptionChange} allLanguages={[]} + siteLanguages={[]} /> @@ -261,6 +272,14 @@ export class CommunityForm extends Component< +