diff --git a/src/components/fields/DocLabel.jsx b/src/components/fields/DocLabel.jsx index 65d7193b..5f5edac0 100644 --- a/src/components/fields/DocLabel.jsx +++ b/src/components/fields/DocLabel.jsx @@ -10,13 +10,36 @@ export default class DocLabel extends React.Component { doc: PropTypes.string.isRequired, } + constructor (props) { + super(props); + this.state = { + open: false, + } + } + + onToggleDoc = (open) => { + this.setState({ + open, + }, () => { + if (this.props.onToggleDoc) { + this.props.onToggleDoc(this.state.open); + } + }); + } + render() { return } diff --git a/src/components/inputs/InputBlock.jsx b/src/components/inputs/InputBlock.jsx index 117ba3ee..0645acfa 100644 --- a/src/components/inputs/InputBlock.jsx +++ b/src/components/inputs/InputBlock.jsx @@ -18,11 +18,24 @@ class InputBlock extends React.Component { onChange: PropTypes.func, } + constructor (props) { + super(props); + this.state = { + showDoc: false, + } + } + onChange(e) { const value = e.target.value return this.props.onChange(value === "" ? undefined : value) } + onToggleDoc = (val) => { + this.setState({ + showDoc: val + }); + } + render() { return
} @@ -52,6 +66,14 @@ class InputBlock extends React.Component {