From: drumlinish <138327213+drumlinish@users.noreply.github.com>
Date: Tue, 15 Aug 2023 01:21:40 +0000 (+0200)
Subject: Moved title field to the top of post-form (#2039, #2059) (#2061)
X-Git-Url: http://these/git/%7B%60%24%7BghostArchiveUrl%7D/%22%7Burl%7D/static/%24%7Bsubmission.url%7D?a=commitdiff_plain;h=c8ab91bdd6c3ed5bb2e072cfa3f4ccd31de0c66e;p=lemmy-ui.git

Moved title field to the top of post-form (#2039, #2059) (#2061)

* Moved title field to the top of post-form

* Remove whitespace

* Trigger build

* Trigger build

---------

Co-authored-by: drumlin <>
---

diff --git a/src/shared/components/post/post-form.tsx b/src/shared/components/post/post-form.tsx
index 7b37926..301cf43 100644
--- a/src/shared/components/post/post-form.tsx
+++ b/src/shared/components/post/post-form.tsx
@@ -342,6 +342,32 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
             ) && !this.state.submitted
           }
         />
+        <div className="mb-3 row">
+          <label className="col-sm-2 col-form-label" htmlFor="post-title">
+            {I18NextService.i18n.t("title")}
+          </label>
+          <div className="col-sm-10">
+            <textarea
+              value={this.state.form.name}
+              id="post-title"
+              onInput={linkEvent(this, handlePostNameChange)}
+              className={`form-control ${
+                !validTitle(this.state.form.name) && "is-invalid"
+              }`}
+              required
+              rows={1}
+              minLength={3}
+              maxLength={MAX_POST_TITLE_LENGTH}
+            />
+            {!validTitle(this.state.form.name) && (
+              <div className="invalid-feedback">
+                {I18NextService.i18n.t("invalid_post_title")}
+              </div>
+            )}
+            {this.renderSuggestedPosts()}
+          </div>
+        </div>
+
         <div className="mb-3 row">
           <label className="col-sm-2 col-form-label" htmlFor="post-url">
             {I18NextService.i18n.t("url")}
@@ -453,32 +479,6 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
           )}
         </div>
 
-        <div className="mb-3 row">
-          <label className="col-sm-2 col-form-label" htmlFor="post-title">
-            {I18NextService.i18n.t("title")}
-          </label>
-          <div className="col-sm-10">
-            <textarea
-              value={this.state.form.name}
-              id="post-title"
-              onInput={linkEvent(this, handlePostNameChange)}
-              className={`form-control ${
-                !validTitle(this.state.form.name) && "is-invalid"
-              }`}
-              required
-              rows={1}
-              minLength={3}
-              maxLength={MAX_POST_TITLE_LENGTH}
-            />
-            {!validTitle(this.state.form.name) && (
-              <div className="invalid-feedback">
-                {I18NextService.i18n.t("invalid_post_title")}
-              </div>
-            )}
-            {this.renderSuggestedPosts()}
-          </div>
-        </div>
-
         <div className="mb-3 row">
           <label className="col-sm-2 col-form-label">
             {I18NextService.i18n.t("body")}