From b8a9da32f0a3471eb3a35acf6def5b12a18df805 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 24 Apr 2019 09:58:45 -0700 Subject: [PATCH] A New comment highlighter --- ui/src/components/comment-node.tsx | 9 ++++++++- ui/src/css/main.css | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 88d6476d..dfc75350 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -3,6 +3,7 @@ import { Link } from 'inferno-router'; import { CommentNode as CommentNodeI, CommentLikeForm, CommentForm as CommentFormI, SaveCommentForm, BanFromCommunityForm, BanUserForm, CommunityUser, UserView, AddModToCommunityForm, AddAdminForm } from '../interfaces'; import { WebSocketService, UserService } from '../services'; import { mdToHtml, getUnixTime, canMod, isMod } from '../utils'; +import * as moment from 'moment'; import { MomentTime } from './moment-time'; import { CommentForm } from './comment-form'; import { CommentNodes } from './comment-nodes'; @@ -65,7 +66,7 @@ export class CommentNode extends Component { -
+
  • {node.comment.creator_name} @@ -420,4 +421,10 @@ export class CommentNode extends Component { WebSocketService.Instance.addAdmin(form); i.setState(i.state); } + + get isCommentNew(): boolean { + let now = moment.utc().subtract(10, 'minutes'); + let then = moment.utc(this.props.node.comment.published); + return now.isBefore(then); + } } diff --git a/ui/src/css/main.css b/ui/src/css/main.css index 61e068cd..61acb014 100644 --- a/ui/src/css/main.css +++ b/ui/src/css/main.css @@ -32,7 +32,7 @@ } .mark { - background-color: #322a00; + background-color: #333; } .md-div p { -- 2.44.1