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
973 B
39 lines
973 B
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
import emojify from '../../../emoji';
|
|
import Toggle from 'react-toggle';
|
|
|
|
export default class StatusCheckBox extends React.PureComponent {
|
|
|
|
static propTypes = {
|
|
status: ImmutablePropTypes.map.isRequired,
|
|
checked: PropTypes.bool,
|
|
onToggle: PropTypes.func.isRequired,
|
|
disabled: PropTypes.bool,
|
|
};
|
|
|
|
render () {
|
|
const { status, checked, onToggle, disabled } = this.props;
|
|
const content = { __html: emojify(status.get('content')) };
|
|
|
|
if (status.get('reblog')) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div className='status-check-box'>
|
|
<div
|
|
className='status__content'
|
|
dangerouslySetInnerHTML={content}
|
|
/>
|
|
|
|
<div className='status-check-box-toggle'>
|
|
<Toggle checked={checked} onChange={onToggle} disabled={disabled} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
}
|