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
958 B

  1. import PropTypes from 'prop-types';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import emojify from '../../../emoji';
  4. import Toggle from 'react-toggle';
  5. class StatusCheckBox extends React.PureComponent {
  6. render () {
  7. const { status, checked, onToggle, disabled } = this.props;
  8. const content = { __html: emojify(status.get('content')) };
  9. if (status.get('reblog')) {
  10. return null;
  11. }
  12. return (
  13. <div className='status-check-box'>
  14. <div
  15. className='status__content'
  16. dangerouslySetInnerHTML={content}
  17. />
  18. <div className='status-check-box-toggle'>
  19. <Toggle checked={checked} onChange={onToggle} disabled={disabled} />
  20. </div>
  21. </div>
  22. );
  23. }
  24. }
  25. StatusCheckBox.propTypes = {
  26. status: ImmutablePropTypes.map.isRequired,
  27. checked: PropTypes.bool,
  28. onToggle: PropTypes.func.isRequired,
  29. disabled: PropTypes.bool
  30. };
  31. export default StatusCheckBox;