diff --git a/src/components/Button.jsx b/src/components/Button.jsx index 0d350b0..4c2105f 100644 --- a/src/components/Button.jsx +++ b/src/components/Button.jsx @@ -20,7 +20,8 @@ class Button extends React.Component { aria-label={this.props["aria-label"]} className={classnames("maputnik-button", this.props.className)} data-wd-key={this.props["data-wd-key"]} - style={this.props.style}> + style={this.props.style} + > {this.props.children} } diff --git a/src/components/fields/ColorField.jsx b/src/components/fields/ColorField.jsx index 9cb44f8..cc77d69 100644 --- a/src/components/fields/ColorField.jsx +++ b/src/components/fields/ColorField.jsx @@ -13,7 +13,7 @@ function formatColor(color) { class ColorField extends React.Component { static propTypes = { onChange: PropTypes.func.isRequired, - name: PropTypes.string.isRequired, + name: PropTypes.string, value: PropTypes.string, doc: PropTypes.string, style: PropTypes.object, diff --git a/src/components/fields/DocLabel.jsx b/src/components/fields/DocLabel.jsx index 65d7193..83fd624 100644 --- a/src/components/fields/DocLabel.jsx +++ b/src/components/fields/DocLabel.jsx @@ -1,23 +1,56 @@ import React from 'react' import PropTypes from 'prop-types' +import {MdInfoOutline, MdHighlightOff} from 'react-icons/md' + export default class DocLabel extends React.Component { static propTypes = { label: PropTypes.oneOfType([ PropTypes.object, PropTypes.string ]).isRequired, - doc: PropTypes.string.isRequired, + fieldSpec: PropTypes.object.isRequired, + onToggleDoc: PropTypes.func.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