Move display logic into parent of switcher

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

View File

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

View File

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