From 05f0aee3ea88d3982e2efe6230f8c591540e4c92 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 27 Mar 2019 12:54:55 -0700 Subject: Adding moment time parsing --- ui/src/components/post.tsx | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'ui/src/components/post.tsx') diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index 5e383c09..867e1a4a 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -4,6 +4,7 @@ import { retryWhen, delay, take } from 'rxjs/operators'; import { UserOperation, Community, Post as PostI, PostResponse, Comment, CommentForm as CommentFormI, CommentResponse } from '../interfaces'; import { WebSocketService, UserService } from '../services'; import { msgOp } from '../utils'; +import { MomentTime } from './moment-time'; interface CommentNodeI { comment: Comment; @@ -74,14 +75,17 @@ export class Post extends Component { postHeader() { let title = this.state.post.url - ?
{this.state.post.name}
+ ?
+ {this.state.post.name} + {(new URL(this.state.post.url)).hostname} +
:
{this.state.post.name}
; return (
- {title} - via {this.state.post.attributed_to} X hours ago - {this.state.post.body} -
+
{title}
+
via {this.state.post.attributed_to}
+
{this.state.post.body}
+ ) } @@ -90,7 +94,7 @@ export class Post extends Component {

New Comments

{this.state.comments.map(comment => - + )}
) @@ -163,6 +167,7 @@ interface CommentNodesState { interface CommentNodesProps { nodes: Array; + noIndent?: boolean; } export class CommentNodes extends Component { @@ -177,7 +182,7 @@ export class CommentNodes extends Component {this.props.nodes.map(node => -
+
20
@@ -190,14 +195,14 @@ export class CommentNodes extends Component
  • ( - +1300 + +1300 | -29 - ) points + )
  • - X hours ago +
  • {node.comment.content}

    -- cgit v1.2.3