From 61dfc2f74a78f1d681adcc01997c660ab10f8223 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 5 Oct 2020 11:44:38 -0400 Subject: [PATCH] handle comment time display correctly immediately after posting --- ui/component/comment/view.jsx | 6 +++--- ui/component/dateTime/view.jsx | 7 ++++++- ui/scss/component/_comments.scss | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ui/component/comment/view.jsx b/ui/component/comment/view.jsx index 917623975..c6edd35a4 100644 --- a/ui/component/comment/view.jsx +++ b/ui/component/comment/view.jsx @@ -177,9 +177,9 @@ function Comment(props: Props) { className="button--uri-indicator" navigate={`${uri}?lc=${commentId}`} label={ - + + + } /> diff --git a/ui/component/dateTime/view.jsx b/ui/component/dateTime/view.jsx index 28cd814ac..13b02da80 100644 --- a/ui/component/dateTime/view.jsx +++ b/ui/component/dateTime/view.jsx @@ -35,7 +35,12 @@ class DateTime extends React.PureComponent { // Strip off the 's' for the singular suffix, construct the string ID, // then load the localized version. const suffix = duration === 1 ? suffixList[i].substr(0, suffixList[i].length - 1) : suffixList[i]; - const strId = '%duration% ' + suffix + ' ago'; + let strId = '%duration% ' + suffix + ' ago'; + + if (!suffix) { + strId = 'Just now'; + } + return __(strId, { duration }); } diff --git a/ui/scss/component/_comments.scss b/ui/scss/component/_comments.scss index 1d80ed9e3..b8fe8f943 100644 --- a/ui/scss/component/_comments.scss +++ b/ui/scss/component/_comments.scss @@ -151,7 +151,7 @@ $thumbnailWidthSmall: 1.5rem; } .comment__time { - opacity: 0.3; + opacity: 0.5; white-space: nowrap; height: 100%; }