Skip to content

Commit 433bf4a

Browse files
committed
Style adjustments
1 parent fa9fcb3 commit 433bf4a

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

src/components/fields/AxisCreator.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,21 @@ class UnconnectedNewAxisCreator extends Component {
7777
render() {
7878
const icon = <PlusIcon />;
7979
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+
);
8085

8186
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+
/>
10095
);
10196
}
10297
}

src/components/fields/Field.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Field extends Component {
2626
localize: _,
2727
multiValued,
2828
units,
29+
extraComponent,
2930
} = this.props;
3031

3132
let fieldClass;
@@ -57,6 +58,7 @@ class Field extends Component {
5758
</div>
5859
</MenuPanel>
5960
) : null}
61+
{extraComponent ? extraComponent : null}
6062
</div>
6163
{units ? (
6264
<div className={bem('field', 'units')}>
@@ -75,6 +77,7 @@ Field.propTypes = {
7577
units: PropTypes.string,
7678
multiValued: PropTypes.bool,
7779
children: PropTypes.node,
80+
extraComponent: PropTypes.any,
7881
};
7982

8083
Field.defaultProps = {

src/styles/_mixins.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969
}
7070
}
7171

72-
&:hover {
72+
&:hover:not(.button--no-text--disabled) {
7373
background-color: var(--color-button-#{$variant}-hover-fill);
7474
border: 1px solid var(--color-button-#{$variant}-hover-border);
7575
color: var(--color-button-#{$variant}-hover-text);
7676
}
77-
&:active {
77+
&:active:not(.button--no-text--disabled) {
7878
background-color: var(--color-button-#{$variant}-active-fill);
7979
border: 1px solid var(--color-button-#{$variant}-active-border);
8080
color: var(--color-button-#{$variant}-active-text);

src/styles/components/widgets/_button.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ button {
5959
margin-right: var(--spacing-half-unit);
6060
}
6161

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+
6275
&--default {
6376
@include button();
6477
}

0 commit comments

Comments
 (0)