Move display logic into parent of switcher
parent
d5283dccc9
commit
b4964af675
|
@ -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}
|
||||
|
|
|
@ -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})}
|
||||
|
|
Loading…
Reference in New Issue