Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Lelana villa
Added: May 7, 2018 8:09 AM
Views: 15
Tags: no tags
  1. import React, { Component } from 'react';
  2. import { Link } from 'react-router';
  3. import TimeAgo from '../TimeAgo';
  4.  
  5. class Comment extends Component {
  6.   render() {
  7.     return (
  8.       <div className="comment">
  9.         <Link to={`/profile/${this.props.userId}`}>
  10.           <div className="actor">
  11.             {this.props.firstName}{' '}
  12.             {this.props.lastName.charAt(0) + '.'}
  13.           </div>
  14.         </Link>
  15.         <div className="time">
  16.           <TimeAgo timestamp={this.props.createdAt} />
  17.         </div>
  18.         <div className="text">
  19.           {this.props.comment}
  20.         </div>
  21.       </div>
  22.     );
  23.   }
  24. }
  25.  
  26. export default Comment;