From 9941bc651910f34a2089a705150fb5cb82a5ab5b Mon Sep 17 00:00:00 2001 From: SatsAllDay <128755788+SatsAllDay@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:07:00 -0400 Subject: [PATCH] render "reply" or "replies", "comment" or "comments" depending on the count (singular or plural) (#382) Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> --- components/comment.js | 1 + components/item-info.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/comment.js b/components/comment.js index f3a4b1fed..ef9b29d7b 100644 --- a/components/comment.js +++ b/components/comment.js @@ -148,6 +148,7 @@ export default function Comment ({ item={item} pendingSats={pendingSats} commentsText='replies' + commentTextSingular='reply' className={`${itemStyles.other} ${styles.other}`} embellishUser={op && OP} extraInfo={ diff --git a/components/item-info.js b/components/item-info.js index fd24eff79..8dfe7516c 100644 --- a/components/item-info.js +++ b/components/item-info.js @@ -17,7 +17,7 @@ import BookmarkDropdownItem from './bookmark' import SubscribeDropdownItem from './subscribe' import { CopyLinkDropdownItem } from './share' -export default function ItemInfo ({ item, pendingSats, full, commentsText, className, embellishUser, extraInfo, onEdit, editText }) { +export default function ItemInfo ({ item, pendingSats, full, commentsText, commentTextSingular, className, embellishUser, extraInfo, onEdit, editText }) { const editThreshold = new Date(item.createdAt).getTime() + 10 * 60000 const me = useMe() const router = useRouter() @@ -58,7 +58,7 @@ export default function ItemInfo ({ item, pendingSats, full, commentsText, class } }} title={numWithUnits(item.commentSats)} className='text-reset position-relative' > - {item.ncomments} {commentsText || 'comments'} + {item.ncomments} {item.ncomments === 1 ? commentTextSingular || 'comment' : commentsText || 'comments'} {hasNewComments && {' '}