From c6f883f88c58a88926bf164c400fca8be9639192 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 7 Jan 2016 18:53:24 +0000 Subject: [PATCH] Conditional render of icon component --- static/src/js/components/navbar/item.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/src/js/components/navbar/item.js b/static/src/js/components/navbar/item.js index bdaa72a..1039a16 100644 --- a/static/src/js/components/navbar/item.js +++ b/static/src/js/components/navbar/item.js @@ -2,8 +2,14 @@ import React from 'react'; export default class Item extends React.Component { render() { + let icon; + if (this.props.icon) { + icon = ( + + ); + } return ( -
  • {this.props.children}
  • +
  • {icon} {this.props.children}
  • ); } }