Move display logic into parent of switcher

pull/10616/head
Alex P 2017-10-19 11:54:50 -07:00 committed by Andrew Watkins
parent d91e5f67e9
commit fa9c12e7cc
2 changed files with 7 additions and 9 deletions

View File

@ -40,11 +40,13 @@ const DashboardHeader = ({
: 'page-header__left' : 'page-header__left'
} }
> >
<DashboardSwitcher {dashboards.length > 1
dashboards={dashboards} ? <DashboardSwitcher
currentDashboard={dashboardName} dashboards={dashboards}
sourceID={sourceID} currentDashboard={dashboardName}
/> sourceID={sourceID}
/>
: null}
{dashboard {dashboard
? <DashboardHeaderEdit ? <DashboardHeaderEdit
onSave={onSave} onSave={onSave}

View File

@ -28,10 +28,6 @@ class DashboardSwitcher extends Component {
const {dashboards, currentDashboard, sourceID} = this.props const {dashboards, currentDashboard, sourceID} = this.props
const {isOpen} = this.state const {isOpen} = this.state
if (dashboards.length <= 1) {
return null
}
return ( return (
<div <div
className={classnames('dropdown dashboard-switcher', {open: isOpen})} className={classnames('dropdown dashboard-switcher', {open: isOpen})}