import React from 'react'; import { Link } from 'react-router-dom'; export default class RichModuleCheckbox extends React.Component { constructor() { super(); this.state = { isEnabled: false, } this.onChange = this.onChange.bind(this); } componentDidMount() { this.setState({ isEnabled: this.props.defaultValue }); } componentWillReceiveProps(props) { if (props.defaultValue === this.state.isEnabled) { return; } this.setState({ isEnabled: props.defaultValue }); } async onChange() { this.props.onChange(this.props.identifier, !this.state.isEnabled); this.setState({ isEnabled: !this.state.isEnabled }); } render() { // const params = { id: 123 }; const params = this.props.match.params; const module = this.props.module; let spanProps = {}; if (this.props.description) { spanProps = { className: 'hint--bottom hint--large hint--info hint--rounded', 'aria-label': this.props.description, }; } return (
{this.props.helpText}
) : ''} {(module.hasPartial || module.hasCommands) && (