The code powering m.abunchtell.com https://m.abunchtell.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

56 rindas
2.0 KiB

  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. import emojify from '../../../emoji';
  7. import { injectIntl } from 'react-intl';
  8. const ReplyIndicator = React.createClass({
  9. contextTypes: {
  10. router: React.PropTypes.object
  11. },
  12. propTypes: {
  13. status: ImmutablePropTypes.map.isRequired,
  14. onCancel: React.PropTypes.func.isRequired
  15. },
  16. mixins: [PureRenderMixin],
  17. handleClick () {
  18. this.props.onCancel();
  19. },
  20. handleAccountClick (e) {
  21. if (e.button === 0) {
  22. e.preventDefault();
  23. this.context.router.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);
  24. }
  25. },
  26. render () {
  27. const { intl } = this.props;
  28. const content = { __html: emojify(this.props.status.get('content')) };
  29. return (
  30. <div style={{ background: '#9baec8', padding: '10px' }}>
  31. <div style={{ overflow: 'hidden', marginBottom: '5px' }}>
  32. <div style={{ float: 'right', lineHeight: '24px' }}><IconButton title={intl.formatMessage({ id: 'reply_indicator.cancel', defaultMessage: 'Cancel' })} icon='times' onClick={this.handleClick} /></div>
  33. <a href={this.props.status.getIn(['account', 'url'])} onClick={this.handleAccountClick} className='reply-indicator__display-name' style={{ display: 'block', maxWidth: '100%', paddingRight: '25px', color: '#282c37', textDecoration: 'none', overflow: 'hidden', lineHeight: '24px' }}>
  34. <div style={{ float: 'left', marginRight: '5px' }}><Avatar size={24} src={this.props.status.getIn(['account', 'avatar'])} /></div>
  35. <DisplayName account={this.props.status.get('account')} />
  36. </a>
  37. </div>
  38. <div className='reply-indicator__content' dangerouslySetInnerHTML={content} />
  39. </div>
  40. );
  41. }
  42. });
  43. export default injectIntl(ReplyIndicator);