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.

41 lines
1.5 KiB

7 years ago
  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import Avatar from '../../../components/avatar';
  4. import IconButton from '../../../components/icon_button';
  5. import DisplayName from '../../../components/display_name';
  6. const ReplyIndicator = React.createClass({
  7. propTypes: {
  8. status: ImmutablePropTypes.map.isRequired,
  9. onCancel: React.PropTypes.func.isRequired
  10. },
  11. mixins: [PureRenderMixin],
  12. handleClick () {
  13. this.props.onCancel();
  14. },
  15. render () {
  16. let content = { __html: this.props.status.get('content') };
  17. return (
  18. <div style={{ background: '#9baec8', padding: '10px' }}>
  19. <div style={{ overflow: 'hidden', marginBottom: '5px' }}>
  20. <div style={{ float: 'right', lineHeight: '24px' }}><IconButton title='Cancel' icon='times' onClick={this.handleClick} /></div>
  21. <a href={this.props.status.getIn(['account', 'url'])} className='reply-indicator__display-name' style={{ display: 'block', maxWidth: '100%', paddingRight: '25px', color: '#282c37', textDecoration: 'none', overflow: 'hidden', lineHeight: '24px' }}>
  22. <div style={{ float: 'left', marginRight: '5px' }}><Avatar size={24} src={this.props.status.getIn(['account', 'avatar'])} /></div>
  23. <DisplayName account={this.props.status.get('account')} />
  24. </a>
  25. </div>
  26. <div className='reply-indicator__content' dangerouslySetInnerHTML={content} />
  27. </div>
  28. );
  29. }
  30. });
  31. export default ReplyIndicator;