Merge pull request #12922 from influxdata/variables/style-polish
Variables/style polishpull/12961/head^2
commit
0db6e02725
|
@ -82,7 +82,7 @@ class Dropdown extends React.Component<
|
||||||
|
|
||||||
return connectDragSource(
|
return connectDragSource(
|
||||||
connectDropTarget(
|
connectDropTarget(
|
||||||
<div style={{display: 'inline-block'}}>
|
<div className="variable-dropdown--container">
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
{/* TODO: Add variable description to title attribute when it is ready */}
|
{/* TODO: Add variable description to title attribute when it is ready */}
|
||||||
<div className="variable-dropdown--label">
|
<div className="variable-dropdown--label">
|
||||||
|
|
|
@ -21,7 +21,11 @@ $variables-control-bar--gutter: $ix-marg-a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.variable-dropdown {
|
.variable-dropdown {
|
||||||
margin: 0 $variables-control-bar--gutter / 2;
|
margin-right: $variables-control-bar--gutter / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.variable-dropdown--container {
|
||||||
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.variables-spinner-container {
|
.variables-spinner-container {
|
||||||
|
@ -29,7 +33,6 @@ $variables-control-bar--gutter: $ix-marg-a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.variables-control-bar--empty {
|
.variables-control-bar--empty {
|
||||||
background-color: $g3-castle;
|
background-color: $g3-castle;
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
|
@ -40,3 +43,8 @@ $variables-control-bar--gutter: $ix-marg-a;
|
||||||
.variables-control-bar > .techno-spinner {
|
.variables-control-bar > .techno-spinner {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.variables-control-bar.presentation-mode {
|
||||||
|
padding: 8px 0px 0px 8px;
|
||||||
|
min-height: 0px;
|
||||||
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {connect} from 'react-redux'
|
||||||
import {isEmpty} from 'lodash'
|
import {isEmpty} from 'lodash'
|
||||||
import {DragDropContext} from 'react-dnd'
|
import {DragDropContext} from 'react-dnd'
|
||||||
import HTML5Backend from 'react-dnd-html5-backend'
|
import HTML5Backend from 'react-dnd-html5-backend'
|
||||||
|
import classnames from 'classnames'
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import {
|
import {
|
||||||
|
@ -43,6 +44,7 @@ interface StateProps {
|
||||||
variables: Variable[]
|
variables: Variable[]
|
||||||
valuesStatus: RemoteDataState
|
valuesStatus: RemoteDataState
|
||||||
variablesStatus: RemoteDataState
|
variablesStatus: RemoteDataState
|
||||||
|
inPresentationMode: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DispatchProps {
|
interface DispatchProps {
|
||||||
|
@ -71,7 +73,11 @@ class VariablesControlBar extends PureComponent<Props, State> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="variables-control-bar">
|
<div
|
||||||
|
className={classnames('variables-control-bar', {
|
||||||
|
'presentation-mode': this.props.inPresentationMode,
|
||||||
|
})}
|
||||||
|
>
|
||||||
<SpinnerContainer
|
<SpinnerContainer
|
||||||
loading={this.state.initialLoading}
|
loading={this.state.initialLoading}
|
||||||
spinnerComponent={<TechnoSpinner diameterPixels={50} />}
|
spinnerComponent={<TechnoSpinner diameterPixels={50} />}
|
||||||
|
@ -143,7 +149,13 @@ const mstp = (state: AppState, props: OwnProps): StateProps => {
|
||||||
const valuesStatus = getDashboardValuesStatus(state, props.dashboardID)
|
const valuesStatus = getDashboardValuesStatus(state, props.dashboardID)
|
||||||
const variablesStatus = getDashboardVariablesStatus(state)
|
const variablesStatus = getDashboardVariablesStatus(state)
|
||||||
|
|
||||||
return {variables, valuesStatus, variablesStatus}
|
const {
|
||||||
|
app: {
|
||||||
|
ephemeral: {inPresentationMode},
|
||||||
|
},
|
||||||
|
} = state
|
||||||
|
|
||||||
|
return {variables, valuesStatus, variablesStatus, inPresentationMode}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default DragDropContext(HTML5Backend)(
|
export default DragDropContext(HTML5Backend)(
|
||||||
|
|
Loading…
Reference in New Issue