From: Dessalines Date: Wed, 24 Apr 2019 16:58:45 +0000 (-0700) Subject: A New comment highlighter X-Git-Url: http://these/git/readmes/%7B%60%24%7BarchiveTodayUrl%7D/static/gitweb.css?a=commitdiff_plain;h=b8a9da32f0a3471eb3a35acf6def5b12a18df805;p=lemmy.git A New comment highlighter --- 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 {