]> Untitled Git - lemmy-ui.git/commitdiff
Merge branch 'main' into feat/move-advanced-post-menu-into-dropdown
authorSleeplessOne1917 <abias1122@gmail.com>
Sun, 18 Jun 2023 13:58:51 +0000 (13:58 +0000)
committerGitHub <noreply@github.com>
Sun, 18 Jun 2023 13:58:51 +0000 (13:58 +0000)
src/shared/components/home/signup.tsx
src/shared/components/person/settings.tsx
src/shared/components/post/post-listing.tsx

index 16a3cc6d3eef61dbb4624a6acdefaf90429b3009..71398a8dbf221bdb0619fe43190a34fac9b4d83b 100644 (file)
@@ -298,27 +298,22 @@ export class Signup extends Component<any, State> {
           </>
         )}
         {this.renderCaptcha()}
-        {siteView.local_site.enable_nsfw && (
-          <div className="form-group row">
-            <div className="col-sm-10">
-              <div className="form-check">
-                <input
-                  className="form-check-input"
-                  id="register-show-nsfw"
-                  type="checkbox"
-                  checked={this.state.form.show_nsfw}
-                  onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
-                />
-                <label
-                  className="form-check-label"
-                  htmlFor="register-show-nsfw"
-                >
-                  {i18n.t("show_nsfw")}
-                </label>
-              </div>
+        <div className="form-group row">
+          <div className="col-sm-10">
+            <div className="form-check">
+              <input
+                className="form-check-input"
+                id="register-show-nsfw"
+                type="checkbox"
+                checked={this.state.form.show_nsfw}
+                onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
+              />
+              <label className="form-check-label" htmlFor="register-show-nsfw">
+                {i18n.t("show_nsfw")}
+              </label>
             </div>
           </div>
-        )}
+        </div>
         <input
           tabIndex={-1}
           autoComplete="false"
index 56d57a7a56850778c7e1a65923d36b4b38e2e0e9..34303cb2775f56ecd32067b29578451de7f904f4 100644 (file)
@@ -21,7 +21,6 @@ import {
   debounce,
   elementUrl,
   emDash,
-  enableNsfw,
   fetchCommunities,
   fetchThemeList,
   fetchUsers,
@@ -642,22 +641,20 @@ export class Settings extends Component<any, SettingsState> {
               />
             </div>
           </form>
-          {enableNsfw(this.state.siteRes) && (
-            <div className="form-group">
-              <div className="form-check">
-                <input
-                  className="form-check-input"
-                  id="user-show-nsfw"
-                  type="checkbox"
-                  checked={this.state.saveUserSettingsForm.show_nsfw}
-                  onChange={linkEvent(this, this.handleShowNsfwChange)}
-                />
-                <label className="form-check-label" htmlFor="user-show-nsfw">
-                  {i18n.t("show_nsfw")}
-                </label>
-              </div>
+          <div className="form-group">
+            <div className="form-check">
+              <input
+                className="form-check-input"
+                id="user-show-nsfw"
+                type="checkbox"
+                checked={this.state.saveUserSettingsForm.show_nsfw}
+                onChange={linkEvent(this, this.handleShowNsfwChange)}
+              />
+              <label className="form-check-label" htmlFor="user-show-nsfw">
+                {i18n.t("show_nsfw")}
+              </label>
             </div>
-          )}
+          </div>
           <div className="form-group">
             <div className="form-check">
               <input
index 3739ad78653be15872b76bdf0d0e5912e965e86a..56961e22f86a20679f1a851a63c931e43feac187 100644 (file)
@@ -497,7 +497,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
     const post = this.postView.post;
     return (
       <Link
-        className={`d-inline-block ${
+        className={`d-inline ${
           !post.featured_community && !post.featured_local
             ? "text-body"
             : "text-primary"
@@ -505,8 +505,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
         to={`/post/${post.id}`}
         title={i18n.t("comments")}
       >
-        <div
-          className="d-inline-block"
+        <span
+          className="d-inline"
           dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
         />
       </Link>
@@ -519,88 +519,80 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
 
     return (
       <div className="post-title overflow-hidden">
-        <h5>
-          {url ? (
-            this.props.showBody ? (
-              <a
-                className={`d-inline-block ${
-                  !post.featured_community && !post.featured_local
-                    ? "text-body"
-                    : "text-primary"
-                }`}
-                href={url}
-                title={url}
-                rel={relTags}
-              >
-                <div
-                  className="d-inline-block"
-                  dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
-                />
-              </a>
-            ) : (
-              this.postLink
-            )
+        <h5 className="d-inline">
+          {url && this.props.showBody ? (
+            <a
+              className={
+                !post.featured_community && !post.featured_local
+                  ? "text-body"
+                  : "text-primary"
+              }
+              href={url}
+              title={url}
+              rel={relTags}
+              dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
+            ></a>
           ) : (
             this.postLink
           )}
-          {(url && isImage(url)) ||
-            (post.thumbnail_url && (
-              <button
-                className="btn btn-link text-monospace text-muted small d-inline-block"
-                data-tippy-content={i18n.t("expand_here")}
-                onClick={linkEvent(this, this.handleImageExpandClick)}
-              >
-                <Icon
-                  icon={
-                    !this.state.imageExpanded ? "plus-square" : "minus-square"
-                  }
-                  classes="icon-inline"
-                />
-              </button>
-            ))}
-          {post.removed && (
-            <small className="ml-2 text-muted font-italic">
-              {i18n.t("removed")}
-            </small>
-          )}
-          {post.deleted && (
-            <small
-              className="unselectable pointer ml-2 text-muted font-italic"
-              data-tippy-content={i18n.t("deleted")}
-            >
-              <Icon icon="trash" classes="icon-inline text-danger" />
-            </small>
-          )}
-          {post.locked && (
-            <small
-              className="unselectable pointer ml-2 text-muted font-italic"
-              data-tippy-content={i18n.t("locked")}
-            >
-              <Icon icon="lock" classes="icon-inline text-danger" />
-            </small>
-          )}
-          {post.featured_community && (
-            <small
-              className="unselectable pointer ml-2 text-muted font-italic"
-              data-tippy-content={i18n.t("featured")}
-            >
-              <Icon icon="pin" classes="icon-inline text-primary" />
-            </small>
-          )}
-          {post.featured_local && (
-            <small
-              className="unselectable pointer ml-2 text-muted font-italic"
-              data-tippy-content={i18n.t("featured")}
-            >
-              <Icon icon="pin" classes="icon-inline text-secondary" />
-            </small>
-          )}
-          {post.nsfw && (
-            <small className="ml-2 text-muted font-italic">
-              {i18n.t("nsfw")}
-            </small>
-          )}
         </h5>
+        {(url && isImage(url)) ||
+          (post.thumbnail_url && (
+            <button
+              className="btn btn-link text-monospace text-muted small d-inline-block"
+              data-tippy-content={i18n.t("expand_here")}
+              onClick={linkEvent(this, this.handleImageExpandClick)}
+            >
+              <Icon
+                icon={
+                  !this.state.imageExpanded ? "plus-square" : "minus-square"
+                }
+                classes="icon-inline"
+              />
+            </button>
+          ))}
+        {post.removed && (
+          <small className="ml-2 text-muted font-italic">
+            {i18n.t("removed")}
+          </small>
+        )}
+        {post.deleted && (
+          <small
+            className="unselectable pointer ml-2 text-muted font-italic"
+            data-tippy-content={i18n.t("deleted")}
+          >
+            <Icon icon="trash" classes="icon-inline text-danger" />
+          </small>
+        )}
+        {post.locked && (
+          <small
+            className="unselectable pointer ml-2 text-muted font-italic"
+            data-tippy-content={i18n.t("locked")}
+          >
+            <Icon icon="lock" classes="icon-inline text-danger" />
+          </small>
+        )}
+        {post.featured_community && (
+          <small
+            className="unselectable pointer ml-2 text-muted font-italic"
+            data-tippy-content={i18n.t("featured")}
+          >
+            <Icon icon="pin" classes="icon-inline text-primary" />
+          </small>
+        )}
+        {post.featured_local && (
+          <small
+            className="unselectable pointer ml-2 text-muted font-italic"
+            data-tippy-content={i18n.t("featured")}
+          >
+            <Icon icon="pin" classes="icon-inline text-secondary" />
+          </small>
+        )}
+        {post.nsfw && (
+          <small className="ml-2 text-muted font-italic">
+            {i18n.t("nsfw")}
+          </small>
+        )}
       </div>
     );
   }