]> Untitled Git - lemmy-ui.git/commitdiff
Fixed unclickable button paddings
authorFlorian Heft <flo@fam-heft.de>
Mon, 12 Jun 2023 08:30:37 +0000 (10:30 +0200)
committerFlorian Heft <flo@fam-heft.de>
Mon, 12 Jun 2023 09:40:44 +0000 (11:40 +0200)
* Remove the wrapping <button> element that
  visually seems clickable but has no click
  handling (only its child link can be
  clicked)
* fixes #1193

src/shared/components/comment/comment-node.tsx
src/shared/components/post/post-listing.tsx

index e6efcef87cb1d1fc05344f1283eb378341d972a9..f80cc8b595d0919035477710e0a6e6eab7f3df01 100644 (file)
@@ -436,15 +436,13 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                         <>
                           {!this.myComment && (
                             <>
-                              <button className="btn btn-link btn-animate">
-                                <Link
-                                  className="text-muted"
-                                  to={`/create_private_message/${cv.creator.id}`}
-                                  title={i18n.t("message").toLowerCase()}
-                                >
-                                  <Icon icon="mail" />
-                                </Link>
-                              </button>
+                              <Link
+                                className="btn btn-link btn-animate text-muted"
+                                to={`/create_private_message/${cv.creator.id}`}
+                                title={i18n.t("message").toLowerCase()}
+                              >
+                                <Icon icon="mail" />
+                              </Link>
                               <button
                                 className="btn btn-link btn-animate text-muted"
                                 onClick={linkEvent(
index 5ba531320f9880f075ce73c99a6159a4ad27f404..5a271943e6d82d414e8b1cfd4f2fc674b42a57a0 100644 (file)
@@ -649,29 +649,27 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
   get commentsButton() {
     const post_view = this.props.post_view;
     return (
-      <button className="btn btn-link text-muted py-0 pl-0">
-        <Link
-          className="text-muted"
-          title={i18n.t("number_of_comments", {
+      <Link
+        className="btn btn-link text-muted py-0 pl-0 text-muted"
+        title={i18n.t("number_of_comments", {
+          count: Number(post_view.counts.comments),
+          formattedCount: Number(post_view.counts.comments),
+        })}
+        to={`/post/${post_view.post.id}?scrollToComments=true`}
+      >
+        <Icon icon="message-square" classes="mr-1" inline />
+        <span className="mr-2">
+          {i18n.t("number_of_comments", {
             count: Number(post_view.counts.comments),
-            formattedCount: Number(post_view.counts.comments),
+            formattedCount: numToSI(post_view.counts.comments),
           })}
-          to={`/post/${post_view.post.id}?scrollToComments=true`}
-        >
-          <Icon icon="message-square" classes="mr-1" inline />
-          <span className="mr-2">
-            {i18n.t("number_of_comments", {
-              count: Number(post_view.counts.comments),
-              formattedCount: numToSI(post_view.counts.comments),
-            })}
+        </span>
+        {this.unreadCount && (
+          <span className="small text-warning">
+            ({this.unreadCount} {i18n.t("new")})
           </span>
-          {this.unreadCount && (
-            <span className="small text-warning">
-              ({this.unreadCount} {i18n.t("new")})
-            </span>
-          )}
-        </Link>
-      </button>
+        )}
+      </Link>
     );
   }