refactor: cleanup

This commit is contained in:
David Ralph
2021-08-15 22:28:37 +01:00
parent 5e4a14ba2c
commit 4f5233fab9
44 changed files with 133 additions and 234 deletions

View File

@@ -1,10 +1,8 @@
import { PureComponent } from 'react';
import { Switch as SwitchUI, FormControlLabel } from '@material-ui/core';
import EventBus from '../../../../modules/helpers/eventbus';
import SwitchUI from '@material-ui/core/Switch';
import FormControlLabel from '@material-ui/core/FormControlLabel';
export default class Switch extends PureComponent {
constructor(props) {
super(props);
@@ -34,19 +32,11 @@ export default class Switch extends PureComponent {
}
render() {
let text = this.props.text;
if (this.props.newFeature) {
text = <>{this.props.text} <span className='newFeature'> NEW</span></>;
} else if (this.props.betaFeature) {
text = <>{this.props.text} <span className='newFeature'> BETA</span></>;
}
return (
<>
<FormControlLabel
control={<SwitchUI name={this.props.name} color='primary' checked={this.state.checked} onChange={this.handleChange} />}
label={text}
label={this.props.text}
labelPlacement='start'
/>
<br/>