]> Untitled Git - lemmy-ui.git/commitdiff
fix: Small adjustments to create post form
authorJay Sitter <jay@jaysitter.com>
Wed, 21 Jun 2023 04:20:05 +0000 (00:20 -0400)
committerJay Sitter <jay@jaysitter.com>
Wed, 21 Jun 2023 04:20:05 +0000 (00:20 -0400)
src/shared/components/common/language-select.tsx
src/shared/components/post/create-post.tsx
src/shared/components/post/post-form.tsx

index 619e1a5a6203adb04e9cf7bdbeef7cb4b68ffd01..02deb434a5ef0ca830342f2846b50b0a9f03ef42 100644 (file)
@@ -66,10 +66,9 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
             {i18n.t(this.props.multiple ? "language_plural" : "language")}
           </label>
           <div
-            className={classNames(
-              "input-group",
-              `col-sm-${this.props.multiple ? 9 : 10}`
-            )}
+            className={classNames(`col-sm-${this.props.multiple ? 9 : 10}`, {
+              "input-group": this.props.multiple,
+            })}
           >
             {this.selectBtn}
             {this.props.multiple && (
index ebdf99954b9505108117d5a1a52511ebfb61fed8..ff136c2f2faa7ee664f1397ef94834d381b794b3 100644 (file)
@@ -178,7 +178,7 @@ export class CreatePost extends Component<
               id="createPostForm"
               className="col-12 col-lg-6 offset-lg-3 mb-4"
             >
-              <h5>{i18n.t("create_post")}</h5>
+              <h1 className="h4">{i18n.t("create_post")}</h1>
               <PostForm
                 onCreate={this.handlePostCreate}
                 params={locationState}
index 4b74e07f8e88c77d6ab03041d4e66537bdd530dd..4d58d1a77f6d0abdd1b72c40fa2340bb30640679 100644 (file)
@@ -357,6 +357,13 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
             />
           </div>
         </div>
+        <LanguageSelect
+          allLanguages={this.props.allLanguages}
+          siteLanguages={this.props.siteLanguages}
+          selectedLanguageIds={selectedLangs}
+          multiple={false}
+          onChange={this.handleLanguageChange}
+        />
         {!this.props.post_view && (
           <div className="mb-3 row">
             <label className="col-sm-2 col-form-label" htmlFor="post-community">
@@ -381,30 +388,17 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
           </div>
         )}
         {this.props.enableNsfw && (
-          <div className="mb-3 row">
-            <legend className="col-form-label col-sm-2 pt-0">
-              {i18n.t("nsfw")}
-            </legend>
-            <div className="col-sm-10">
-              <div className="form-check">
-                <input
-                  className="form-check-input position-static"
-                  id="post-nsfw"
-                  type="checkbox"
-                  checked={this.state.form.nsfw}
-                  onChange={linkEvent(this, this.handlePostNsfwChange)}
-                />
-              </div>
-            </div>
+          <div className="form-check mb-3">
+            <input
+              className="form-check-input"
+              id="post-nsfw"
+              type="checkbox"
+              checked={this.state.form.nsfw}
+              onChange={linkEvent(this, this.handlePostNsfwChange)}
+            />
+            <label className="form-check-label">{i18n.t("nsfw")}</label>
           </div>
         )}
-        <LanguageSelect
-          allLanguages={this.props.allLanguages}
-          siteLanguages={this.props.siteLanguages}
-          selectedLanguageIds={selectedLangs}
-          multiple={false}
-          onChange={this.handleLanguageChange}
-        />
         <input
           tabIndex={-1}
           autoComplete="false"