Skip to content

Commit

Permalink
Prevent advanced gas input arrows from setting value to < 0 (#6248)
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm authored Mar 6, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent d547e0b commit f74cd1a
Showing 2 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -80,8 +80,18 @@ export default class AdvancedTabContent extends Component {
'advanced-gas-inputs__gas-edit-row__input--error': isInError && errorType === 'error',
'advanced-gas-inputs__gas-edit-row__input--warning': isInError && errorType === 'warning',
})}>
<div className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value + 1)}><i className="fa fa-sm fa-angle-up" /></div>
<div className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value - 1)}><i className="fa fa-sm fa-angle-down" /></div>
<div
className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap"
onClick={() => onChange(value + 1)}
>
<i className="fa fa-sm fa-angle-up" />
</div>
<div
className="advanced-gas-inputs__gas-edit-row__input-arrows__i-wrap"
onClick={() => onChange(Math.max(value - 1, 0))}
>
<i className="fa fa-sm fa-angle-down" />
</div>
</div>
{ isInError
? <div className={`advanced-gas-inputs__gas-edit-row__${errorType}-text`}>
Original file line number Diff line number Diff line change
@@ -88,8 +88,18 @@ export default class AdvancedTabContent extends Component {
'advanced-tab__gas-edit-row__input--error': isInError && errorType === 'error',
'advanced-tab__gas-edit-row__input--warning': isInError && errorType === 'warning',
})}>
<div className="advanced-tab__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value + 1)}><i className="fa fa-sm fa-angle-up" /></div>
<div className="advanced-tab__gas-edit-row__input-arrows__i-wrap" onClick={() => onChange(value - 1)}><i className="fa fa-sm fa-angle-down" /></div>
<div
className="advanced-tab__gas-edit-row__input-arrows__i-wrap"
onClick={() => onChange(value + 1)}
>
<i className="fa fa-sm fa-angle-up" />
</div>
<div
className="advanced-tab__gas-edit-row__input-arrows__i-wrap"
onClick={() => onChange(Math.max(value - 1, 0))}
>
<i className="fa fa-sm fa-angle-down" />
</div>
</div>
{ isInError
? <div className={`advanced-tab__gas-edit-row__${errorType}-text`}>

0 comments on commit f74cd1a

Please sign in to comment.