The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

39 lines
1.1 KiB

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import emojify from '../../../emoji';
  4. import Toggle from 'react-toggle';
  5. const StatusCheckBox = React.createClass({
  6. propTypes: {
  7. status: ImmutablePropTypes.map.isRequired,
  8. checked: React.PropTypes.bool,
  9. onToggle: React.PropTypes.func.isRequired,
  10. disabled: React.PropTypes.bool
  11. },
  12. mixins: [PureRenderMixin],
  13. render () {
  14. const { status, checked, onToggle, disabled } = this.props;
  15. const content = { __html: emojify(status.get('content')) };
  16. return (
  17. <div className='status-check-box' style={{ display: 'flex' }}>
  18. <div
  19. className='status__content'
  20. style={{ flex: '1 1 auto', padding: '10px' }}
  21. dangerouslySetInnerHTML={content}
  22. />
  23. <div style={{ flex: '0 0 auto', padding: '10px', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
  24. <Toggle checked={checked} onChange={onToggle} disabled={disabled} />
  25. </div>
  26. </div>
  27. );
  28. }
  29. });
  30. export default StatusCheckBox;