about summary refs log tree commit diff
path: root/app/assets/javascripts/components/components/status.jsx
blob: c6d57acedcf844a5046c41cddf87389361a68229 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import ImmutablePropTypes from 'react-immutable-proptypes';
import Avatar             from './avatar';
import DisplayName        from './display_name';
import RelativeTimestamp  from './relative_timestamp';
import PureRenderMixin    from 'react-addons-pure-render-mixin';

const Status = React.createClass({

  propTypes: {
    status: ImmutablePropTypes.map.isRequired
  },

  mixins: [PureRenderMixin],

  render () {
    var content = { __html: this.props.status.get('content') };
    var status  = this.props.status;

    return (
      <div style={{ padding: '8px 10px', display: 'flex', flexDirection: 'row', borderBottom: '1px solid #363c4b', cursor: 'pointer' }}>
        <Avatar src={status.getIn(['account', 'avatar'])} />

        <div style={{ flex: '1 1 auto', marginLeft: '10px' }}>
          <div style={{ overflow: 'hidden' }}>
            <div style={{ float: 'right' }}>
              <a href={status.get('url')} style={{ textDecoration: 'none' }}><RelativeTimestamp timestamp={status.get('created_at')} /></a>
            </div>

            <DisplayName account={status.get('account')} />
          </div>

          <div className='status__content' dangerouslySetInnerHTML={content} style={{ fontSize: '14px' }} />
        </div>
      </div>
    );
  }

});

export default Status;