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