Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added basic logic for up and down <button>s for incrementing / decrem…
…enting the values of the color components.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent d639647 commit 2287c16
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions webpack_in/entry.jsx
Expand Up @@ -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>
);
}
Expand Down

0 comments on commit 2287c16

Please sign in to comment.