Prevent CEO toggle from de-centering when no queries present
parent
2c4637309c
commit
ab5a4682c0
|
@ -16,13 +16,12 @@ const OverlayControls = ({
|
|||
onClickDisplayOptions,
|
||||
}) =>
|
||||
<div className="overlay-controls">
|
||||
{queries.length
|
||||
? <SourceSelector
|
||||
sources={sources}
|
||||
selected={selected}
|
||||
onSetQuerySource={onSetQuerySource}
|
||||
/>
|
||||
: null}
|
||||
<SourceSelector
|
||||
sources={sources}
|
||||
selected={selected}
|
||||
onSetQuerySource={onSetQuerySource}
|
||||
queries={queries}
|
||||
/>
|
||||
<ul className="nav nav-tablist nav-tablist-sm">
|
||||
<li
|
||||
key="queries"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React, {PropTypes} from 'react'
|
||||
import Dropdown from 'shared/components/Dropdown'
|
||||
|
||||
const SourceSelector = ({sources = [], selected, onSetQuerySource}) =>
|
||||
sources.length > 1
|
||||
const SourceSelector = ({sources = [], selected, onSetQuerySource, queries}) =>
|
||||
sources.length > 1 && queries.length
|
||||
? <div className="source-selector">
|
||||
<h3>Source:</h3>
|
||||
<Dropdown
|
||||
|
@ -15,14 +15,15 @@ const SourceSelector = ({sources = [], selected, onSetQuerySource}) =>
|
|||
className="dropdown-240"
|
||||
/>
|
||||
</div>
|
||||
: null
|
||||
: <div className="source-selector" />
|
||||
|
||||
const {arrayOf, func, shape, string} = PropTypes
|
||||
const {array, arrayOf, func, shape, string} = PropTypes
|
||||
|
||||
SourceSelector.propTypes = {
|
||||
sources: arrayOf(shape()).isRequired,
|
||||
onSetQuerySource: func.isRequired,
|
||||
selected: string,
|
||||
queries: array,
|
||||
}
|
||||
|
||||
export default SourceSelector
|
||||
|
|
Loading…
Reference in New Issue