Skip to content

Commit

Permalink
Do not render props table if there are no props (fix #50).
Browse files Browse the repository at this point in the history
  • Loading branch information
sapegin committed Nov 18, 2015
1 parent 1d819cd commit 5d3b835
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/ReactComponent/ReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ export default class ReactComponent extends Component {
);
}

renderProps() {
let props = this.props.component.props.props;
if (!props) {
return null;
}

return (
<Props props={props}/>
);
}

renderExamples() {
let { highlightTheme, component } = this.props;
if (!component.examples) {
Expand Down Expand Up @@ -50,7 +61,7 @@ export default class ReactComponent extends Component {
<div className={s.sourcePath}>{component.relativePath}</div>
</header>
{this.renderDescription()}
<Props props={component.props}/>
{this.renderProps()}
{this.renderExamples()}
</div>
);
Expand Down

0 comments on commit 5d3b835

Please sign in to comment.