You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

  1. import ImmutablePropTypes from 'react-immutable-proptypes';
  2. import Avatar from './avatar';
  3. import DisplayName from './display_name';
  4. import RelativeTimestamp from './relative_timestamp';
  5. import PureRenderMixin from 'react-addons-pure-render-mixin';
  6. const Status = React.createClass({
  7. propTypes: {
  8. status: ImmutablePropTypes.map.isRequired
  9. },
  10. mixins: [PureRenderMixin],
  11. render () {
  12. var content = { __html: this.props.status.get('content') };
  13. var status = this.props.status;
  14. return (
  15. <div style={{ padding: '8px 10px', display: 'flex', flexDirection: 'row', borderBottom: '1px solid #363c4b', cursor: 'pointer' }}>
  16. <Avatar src={status.getIn(['account', 'avatar'])} />
  17. <div style={{ flex: '1 1 auto', marginLeft: '10px' }}>
  18. <div style={{ overflow: 'hidden' }}>
  19. <div style={{ float: 'right' }}>
  20. <a href={status.get('url')} style={{ textDecoration: 'none' }}><RelativeTimestamp timestamp={status.get('created_at')} /></a>
  21. </div>
  22. <DisplayName account={status.get('account')} />
  23. </div>
  24. <div className='status__content' dangerouslySetInnerHTML={content} style={{ fontSize: '14px' }} />
  25. </div>
  26. </div>
  27. );
  28. }
  29. });
  30. export default Status;