Permalink
Browse files

Added basic logic for up and down <button>s for incrementing / decrem…

…enting the values of the color components.
  • Loading branch information...
maratbn committed Jul 2, 2018
1 parent d639647 commit 2287c161c46e6928501a147c30a782f7a98da865
Showing with 18 additions and 0 deletions.
  1. +18 −0 webpack_in/entry.jsx
@@ -276,6 +276,24 @@ class ColorComponentEntry extends React.Component {
this.props.onChangeValue(convertValue(strValueEntered));
}} />
<button onClick={ () => {
const valueNew = this.props.value + 1;
if (valueNew > 255) {
return;
}
this.props.onChangeValue(valueNew);
}}>&#9650;</button>
<button onClick={ () => {
const valueNew = this.props.value - 1;
if (valueNew < 0) {
return;
}
this.props.onChangeValue(valueNew);
}}>&#9660;</button>
</div>
);
}

0 comments on commit 2287c16

Please sign in to comment.