aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/message.jsx
blob: faeb4b4e93c97333de373a156607e5ba6690209b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import React, {PropTypes} from "react"

const Message = React.createClass({
  propTypes: {
    mid: PropTypes.number.isRequired,
    user: PropTypes.shape({
      uid: PropTypes.number.isRequired,
      uname: PropTypes.string.isRequired
    }),
    timestamp: PropTypes.string.isRequired,
    body: PropTypes.string.isRequired
  },
  render() { return (
    <article>
      <aside>
        <a href={this.props.user.uname + "/"}>
          <img src={"//i.juick.com/a/" + this.props.user.uid + ".png"} alt=""/></a>
      </aside>
      <header className="u">@<a href={this.props.user.uname + "/"}>{this.props.user.uname}</a>: </header>
      <header className="t"><a href={this.props.user.uname + "/" + this.props.mid}>
        <time dateTime={this.props.timestamp} title={this.props.timestamp}>{this.props.timestamp}</time></a></header>
      <p>{this.props.body}</p>
    </article>) }
});

export default Message