]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/report/components/status_check_box.js
Restore vanilla components
[mastodon.git] / app / javascript / mastodon / features / report / components / status_check_box.js
1 import React from 'react';
2 import PropTypes from 'prop-types';
3 import ImmutablePropTypes from 'react-immutable-proptypes';
4 import Toggle from 'react-toggle';
5
6 export default class StatusCheckBox extends React.PureComponent {
7
8 static propTypes = {
9 status: ImmutablePropTypes.map.isRequired,
10 checked: PropTypes.bool,
11 onToggle: PropTypes.func.isRequired,
12 disabled: PropTypes.bool,
13 };
14
15 render () {
16 const { status, checked, onToggle, disabled } = this.props;
17 const content = { __html: status.get('contentHtml') };
18
19 if (status.get('reblog')) {
20 return null;
21 }
22
23 return (
24 <div className='status-check-box'>
25 <div
26 className='status__content'
27 dangerouslySetInnerHTML={content}
28 />
29
30 <div className='status-check-box-toggle'>
31 <Toggle checked={checked} onChange={onToggle} disabled={disabled} />
32 </div>
33 </div>
34 );
35 }
36
37 }
This page took 0.06876 seconds and 4 git commands to generate.