Skip to content

Commit

Permalink
fix(PropertyPanel): Add support of show function on prop group
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed May 24, 2018
1 parent 1fbb415 commit ecbb37e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/React/Properties/PropertyPanel/index.js
Expand Up @@ -4,6 +4,10 @@ import PropTypes from 'prop-types';
import style from 'PVWStyle/ReactProperties/PropertyPanel.mcss';
import factory from '../PropertyFactory';

function alwaysShow() {
return true;
}

export default class PropertyPanel extends React.Component {
constructor(props) {
super(props);
Expand All @@ -27,7 +31,12 @@ export default class PropertyPanel extends React.Component {
this.props.onChange ? this.valueChange : undefined
);
const uiContainer = (property) => (
<div key={property.title}>
<div
key={property.title}
style={{
display: (property.show || alwaysShow)(viewData) ? 'block' : 'none',
}}
>
<div className={style.propertyHeader}>
<strong>{property.title}</strong>
</div>
Expand Down

0 comments on commit ecbb37e

Please sign in to comment.