]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/comment/comment-node.tsx
Changes to language tag
[lemmy-ui.git] / src / shared / components / comment / comment-node.tsx
index 16e0a731640f017e235c0ed9ae83e6138e5a4f7a..83477864574e1c7855a3c38a36b07d55c733f425 100644 (file)
@@ -42,6 +42,7 @@ import {
   colorList,
   commentTreeMaxDepth,
   futureDaysToUnixTime,
+  getCommentParentId,
   isAdmin,
   isBanned,
   isMod,
@@ -282,13 +283,15 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                 )}
               </button>
               {this.linkBtn(true)}
-              <span className="mx-1 badge badge-secondary">
-                {
-                  this.props.allLanguages.find(
-                    lang => lang.id === cv.comment.language_id
-                  )?.name
-                }
-              </span>
+              {cv.comment.language_id != 0 && (
+                <span className="">
+                  {
+                    this.props.allLanguages.find(
+                      lang => lang.id === cv.comment.language_id
+                    )?.name
+                  }
+                </span>
+              )}
               {/* This is an expanding spacer for mobile */}
               <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" />
               {showScores() && (
@@ -1051,11 +1054,14 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
       ? i18n.t("show_context")
       : i18n.t("link");
 
+    // The context button should show the parent comment by default
+    const parentCommentId = getCommentParentId(cv.comment) ?? cv.comment.id;
+
     return (
       <>
         <Link
           className={classnames}
-          to={`/comment/${cv.comment.id}`}
+          to={`/comment/${parentCommentId}`}
           title={title}
         >
           <Icon icon="link" classes="icon-inline" />