From f1d120c1fc6cfab86e529fdbbe3b82198042e9b9 Mon Sep 17 00:00:00 2001 From: Jeremy Dagorn Date: Wed, 2 Mar 2016 17:11:09 -0800 Subject: [PATCH] Do not show view toolbar if only one view is specified --- src/Toolbar.jsx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Toolbar.jsx b/src/Toolbar.jsx index df9e3fb65..5964833bb 100644 --- a/src/Toolbar.jsx +++ b/src/Toolbar.jsx @@ -41,14 +41,7 @@ let Toolbar = React.createClass({ { - viewNames.map(name => - - ) + this.viewNamesGroup(messages) } @@ -61,6 +54,25 @@ let Toolbar = React.createClass({ view(view){ this.props.onViewChange(view) + }, + + viewNamesGroup(messages) { + let component = null + let viewNames = this.props.views + const view = this.props.view + + if (viewNames.length > 1) { + return ( + viewNames.map(name => + + ) + ) + } } });