From 0286b6f1a5037022f18861a3810bc34c1543ba35 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 15 Jul 2022 16:50:56 +0700 Subject: [PATCH] added months passed to comments --- src/components/comment/Comment/index.tsx | 2 +- src/components/comment/CommentContent/styles.module.scss | 6 +++++- src/components/comment/CommentDistance/index.tsx | 4 ---- src/components/comment/CommentDistance/styles.module.scss | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/comment/Comment/index.tsx b/src/components/comment/Comment/index.tsx index 0dd9c1ac..3748dc3b 100644 --- a/src/components/comment/Comment/index.tsx +++ b/src/components/comment/Comment/index.tsx @@ -59,7 +59,7 @@ const Comment: FC = memo( return ( 9 && ( + Math.abs(group.distancesInDays[index]) > 30 && ( = memo(({ firstDate, secondDate return undefined; } - if (differenceInDays(secondDate, firstDate) < 30) { - return undefined; - } - return formatDistance(secondDate, firstDate, { locale: ru, addSuffix: false, diff --git a/src/components/comment/CommentDistance/styles.module.scss b/src/components/comment/CommentDistance/styles.module.scss index fc566447..cf009220 100644 --- a/src/components/comment/CommentDistance/styles.module.scss +++ b/src/components/comment/CommentDistance/styles.module.scss @@ -9,4 +9,5 @@ display: inline-flex; padding: 1px 10px 3px; border-radius: 12px; + user-select: none; }