BanFromCommunity,
BanPerson,
BlockPerson,
- CommentNode as CommentNodeI,
CommentReplyView,
CommentView,
CommunityModeratorView,
CreateCommentLike,
CreateCommentReport,
DeleteComment,
- EditComment,
+ DistinguishComment,
GetComments,
Language,
- ListingType,
MarkCommentReplyAsRead,
MarkPersonMentionAsRead,
PersonMentionView,
- PersonViewSafe,
+ PersonView,
PurgeComment,
PurgePerson,
RemoveComment,
} from "lemmy-js-client";
import moment from "moment";
import { i18n } from "../../i18next";
-import { BanType, CommentViewType, PurgeType } from "../../interfaces";
+import {
+ BanType,
+ CommentNodeI,
+ CommentViewType,
+ PurgeType,
+} from "../../interfaces";
import { UserService, WebSocketService } from "../../services";
import {
amCommunityCreator,
colorList,
commentTreeMaxDepth,
futureDaysToUnixTime,
+ getCommentParentId,
isAdmin,
isBanned,
isMod,
interface CommentNodeProps {
node: CommentNodeI;
moderators?: CommunityModeratorView[];
- admins?: PersonViewSafe[];
+ admins?: PersonView[];
noBorder?: boolean;
noIndent?: boolean;
viewOnly?: boolean;
{i18n.t("bot_account").toLowerCase()}
</div>
)}
- {(cv.creator_banned_from_community || isBanned(cv.creator)) && (
- <div className="badge badge-danger mr-2">
- {i18n.t("banned")}
- </div>
- )}
{this.props.showCommunity && (
<>
<span className="mx-1">{i18n.t("to")}</span>
)}
</button>
{this.linkBtn(true)}
+ {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"></div>
+ <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" />
{showScores() && (
<>
<a
<span
className="mr-1 font-weight-bold"
aria-label={i18n.t("number_of_points", {
- count: this.state.score,
- formattedCount: this.state.score,
+ count: Number(this.state.score),
+ formattedCount: numToSI(this.state.score),
})}
>
{numToSI(this.state.score)}
<button className="btn btn-link btn-animate">
<Link
className="text-muted"
- to={`/create_private_message/recipient/${cv.creator.id}`}
+ to={`/create_private_message/${cv.creator.id}`}
title={i18n.t("message").toLowerCase()}
>
<Icon icon="mail" />
this,
this.handleModBanFromCommunityShow
)}
- aria-label={i18n.t("ban")}
+ aria-label={i18n.t("ban_from_community")}
>
- {i18n.t("ban")}
+ {i18n.t("ban_from_community")}
</button>
) : (
<button
? 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" />
let comment = i.props.node.comment_view.comment;
let auth = myAuth();
if (auth) {
- let form: EditComment = {
+ let form: DistinguishComment = {
comment_id: comment.id,
distinguished: !comment.distinguished,
auth,
parent_id: i.props.node.comment_view.comment.id,
max_depth: commentTreeMaxDepth,
limit: 999, // TODO
- type_: ListingType.All,
+ type_: "All",
saved_only: false,
auth: myAuth(false),
};
get pointsTippy(): string {
let points = i18n.t("number_of_points", {
- count: this.state.score,
- formattedCount: this.state.score,
+ count: Number(this.state.score),
+ formattedCount: numToSI(this.state.score),
});
let upvotes = i18n.t("number_of_upvotes", {
- count: this.state.upvotes,
- formattedCount: this.state.upvotes,
+ count: Number(this.state.upvotes),
+ formattedCount: numToSI(this.state.upvotes),
});
let downvotes = i18n.t("number_of_downvotes", {
- count: this.state.downvotes,
- formattedCount: this.state.downvotes,
+ count: Number(this.state.downvotes),
+ formattedCount: numToSI(this.state.downvotes),
});
return `${points} • ${upvotes} • ${downvotes}`;