diff --git a/src/components/categorical/categorical.js b/src/components/categorical/categorical.js index 54b7f65b..58cf8a9b 100644 --- a/src/components/categorical/categorical.js +++ b/src/components/categorical/categorical.js @@ -17,7 +17,8 @@ class Category extends React.Component { constructor(props) { super(props); this.state = { - isChecked: true + isChecked: true, + isExpanded: false }; } @@ -42,6 +43,18 @@ class Category extends React.Component { }) this.setState({isChecked: false}) } + renderCategoryItems() { + return _.map(alphabeticallySortedValues(this.props.values), (v, i) => { + return ( + + ) + }) + } render() { return ( @@ -63,6 +76,13 @@ class Category extends React.Component { // fontStyle: "italic", marginRight: 10, }}> + { + this.setState({isExpanded: !this.state.isExpanded}) + }}> + {this.state.isExpanded ? "⯆ " : "⯈ "} + {this.props.metadataField}
{ - _.map(alphabeticallySortedValues(this.props.values), (v, i) => { - return ( - - ) - }) + this.state.isExpanded ? this.renderCategoryItems() : null }