File tree Expand file tree Collapse file tree 4 files changed +31
-20
lines changed Expand file tree Collapse file tree 4 files changed +31
-20
lines changed Original file line number Diff line number Diff line change @@ -77,26 +77,21 @@ class UnconnectedNewAxisCreator extends Component {
77
77
render ( ) {
78
78
const icon = < PlusIcon /> ;
79
79
const _ = this . props . localize ;
80
+ const extraComponent = this . canAddAxis ( ) ? (
81
+ < Button variant = "no-text" icon = { icon } onClick = { ( ) => this . updateAxis ( ) } />
82
+ ) : (
83
+ < Button variant = "no-text--disabled" icon = { icon } onClick = { ( ) => { } } />
84
+ ) ;
80
85
81
86
return (
82
- < Fragment >
83
- < Dropdown
84
- label = { this . props . label }
85
- attr = { this . props . attr }
86
- clearable = { false }
87
- options = { this . props . options }
88
- updatePlot = { u => this . recalcAxes ( u ) }
89
- />
90
- { this . canAddAxis ( ) ? (
91
- < Button
92
- attr = { this . props . attr }
93
- label = { _ ( 'Axis' ) }
94
- variant = "secondary"
95
- icon = { icon }
96
- onClick = { ( ) => this . updateAxis ( ) }
97
- />
98
- ) : null }
99
- </ Fragment >
87
+ < Dropdown
88
+ label = { this . props . label }
89
+ attr = { this . props . attr }
90
+ clearable = { false }
91
+ options = { this . props . options }
92
+ updatePlot = { u => this . recalcAxes ( u ) }
93
+ extraComponent = { extraComponent }
94
+ />
100
95
) ;
101
96
}
102
97
}
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class Field extends Component {
26
26
localize : _ ,
27
27
multiValued,
28
28
units,
29
+ extraComponent,
29
30
} = this . props ;
30
31
31
32
let fieldClass ;
@@ -57,6 +58,7 @@ class Field extends Component {
57
58
</ div >
58
59
</ MenuPanel >
59
60
) : null }
61
+ { extraComponent ? extraComponent : null }
60
62
</ div >
61
63
{ units ? (
62
64
< div className = { bem ( 'field' , 'units' ) } >
@@ -75,6 +77,7 @@ Field.propTypes = {
75
77
units : PropTypes . string ,
76
78
multiValued : PropTypes . bool ,
77
79
children : PropTypes . node ,
80
+ extraComponent : PropTypes . any ,
78
81
} ;
79
82
80
83
Field . defaultProps = {
Original file line number Diff line number Diff line change 69
69
}
70
70
}
71
71
72
- & :hover {
72
+ & :hover:not ( .button--no-text--disabled ) {
73
73
background-color : var (--color-button - #{$variant } - hover-fill );
74
74
border : 1px solid var (--color-button - #{$variant } - hover-border );
75
75
color : var (--color-button - #{$variant } - hover-text );
76
76
}
77
- & :active {
77
+ & :active:not ( .button--no-text--disabled ) {
78
78
background-color : var (--color-button - #{$variant } - active-fill );
79
79
border : 1px solid var (--color-button - #{$variant } - active-border );
80
80
color : var (--color-button - #{$variant } - active-text );
Original file line number Diff line number Diff line change @@ -59,6 +59,19 @@ button {
59
59
margin-right : var (--spacing-half-unit );
60
60
}
61
61
62
+ & --no-text {
63
+ @include button ();
64
+ padding-right : var (--spacing-quarter-unit );
65
+ margin-left : 5px ;
66
+ & --disabled {
67
+ @include button ();
68
+ padding-right : var (--spacing-quarter-unit );
69
+ margin-left : 5px ;
70
+ color : rgb (186 , 186 , 186 );
71
+ cursor : default ;
72
+ }
73
+ }
74
+
62
75
& --default {
63
76
@include button ();
64
77
}
You can’t perform that action at this time.
0 commit comments