aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/first-time
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-10-05 17:42:19 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-10-05 17:42:19 +0800
commitc0d6dcff00b36e89242695a4a29c5f52f4d3a5be (patch)
treed4c8b4de3fbd2bacb05671061a05d6a6d5ad3986 /ui/app/first-time
parenta59422c01dbea4ec3db08ba5efc2d0baf490c6e0 (diff)
downloadtangerine-wallet-browser-c0d6dcff00b36e89242695a4a29c5f52f4d3a5be.tar.gz
tangerine-wallet-browser-c0d6dcff00b36e89242695a4a29c5f52f4d3a5be.tar.zst
tangerine-wallet-browser-c0d6dcff00b36e89242695a4a29c5f52f4d3a5be.zip
Rewritten to react standards. Way easier.
Diffstat (limited to 'ui/app/first-time')
-rw-r--r--ui/app/first-time/disclaimer.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js
index 312c864d7..3ec0b37c3 100644
--- a/ui/app/first-time/disclaimer.js
+++ b/ui/app/first-time/disclaimer.js
@@ -19,6 +19,9 @@ function DisclaimerScreen () {
}
DisclaimerScreen.prototype.render = function () {
+ const state = this.state || {disclaimerDisabled: true}
+ const disabled = state.disclaimerDisabled
+
return (
h('.flex-column.flex-center.flex-grow', [
@@ -67,15 +70,11 @@ DisclaimerScreen.prototype.render = function () {
h('div.markdown', {
onScroll: (e) => {
var object = e.currentTarget
- var button = document.getElementById('agree')
- if ((object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) && button.disabled) {
- button.disabled = false
- button.innerHTML = 'I Agree'
- button.addEventListener('click', () => this.props.dispatch(actions.agreeToDisclaimer()))
+ if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) {
+ this.setState({disclaimerDisabled: false})
}
},
style: {
- // whiteSpace: 'pre-line',
background: 'rgb(235, 235, 235)',
height: '310px',
padding: '6px',
@@ -91,11 +90,11 @@ DisclaimerScreen.prototype.render = function () {
]),
- h('button#agree', {
+ h('button', {
style: { marginTop: '18px' },
- disabled: true,
+ disabled: disabled,
onClick: () => this.props.dispatch(actions.agreeToDisclaimer()),
- }, 'Scroll Down to Enable'),
+ }, disabled ? 'Scroll Down to Enable' : 'I Agree'),
])
)
}