aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-16 07:26:24 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-16 07:34:07 +0800
commitbdb6e55354ad01fbf0741d0adb99cab8082f6da2 (patch)
tree5bdf81ad6acc2a1f7f8d5d146f8ee301cf87701e /ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
parent8c33c018dead721d7ad3b86d75a8a7abcade3938 (diff)
downloadtangerine-wallet-browser-bdb6e55354ad01fbf0741d0adb99cab8082f6da2.tar.gz
tangerine-wallet-browser-bdb6e55354ad01fbf0741d0adb99cab8082f6da2.tar.zst
tangerine-wallet-browser-bdb6e55354ad01fbf0741d0adb99cab8082f6da2.zip
Decrease click area for AmountMaxButton on send screen
Diffstat (limited to 'ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js')
-rw-r--r--ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js34
1 files changed, 20 insertions, 14 deletions
diff --git a/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js b/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
index 4d0d36ab4..ceb620941 100644
--- a/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
+++ b/ui/app/components/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
@@ -34,21 +34,27 @@ export default class AmountMaxButton extends Component {
})
}
+ onMaxClick = (event) => {
+ const { setMaxModeTo } = this.props
+
+ event.preventDefault()
+ setMaxModeTo(true)
+ this.setMaxAmount()
+ }
+
render () {
- const { setMaxModeTo, maxModeOn } = this.props
-
- return (
- <div
- className="send-v2__amount-max"
- onClick={(event) => {
- event.preventDefault()
- setMaxModeTo(true)
- this.setMaxAmount()
- }}
- >
- {!maxModeOn ? this.context.t('max') : ''}
- </div>
- )
+ return this.props.maxModeOn
+ ? null
+ : (
+ <div>
+ <span
+ className="send-v2__amount-max"
+ onClick={this.onMaxClick}
+ >
+ {this.context.t('max')}
+ </span>
+ </div>
+ )
}
}