terms of service, pop up new html
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ const { Component } = require('preact')
|
||||
const { connect } = require('preact-redux');
|
||||
const linkState = require('linkstate').default;
|
||||
|
||||
const tos = require('./tos');
|
||||
const { postData, errorToast, infoToast } = require('../utils');
|
||||
|
||||
const addState = connect(
|
||||
@@ -34,7 +35,7 @@ function Register(args) {
|
||||
submitRegister,
|
||||
} = args;
|
||||
|
||||
const { password, confirm, name } = this.state;
|
||||
const { password, confirm, name, terms, viewTos } = this.state;
|
||||
|
||||
const registerSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
@@ -45,7 +46,7 @@ function Register(args) {
|
||||
password === confirm;
|
||||
|
||||
const registerDisabled = () => {
|
||||
return !(registerConfirm() && password && name);
|
||||
return !(registerConfirm() && password && name && terms);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -74,6 +75,14 @@ function Register(args) {
|
||||
value={this.state.confirm}
|
||||
onInput={linkState(this, 'confirm')}
|
||||
/>
|
||||
<div>
|
||||
<input
|
||||
type="checkbox"
|
||||
onInput={linkState(this, 'terms')
|
||||
}/>
|
||||
Confirm agreement to terms of service
|
||||
<button onClick={tos}> VIEW </button>
|
||||
</div>
|
||||
<button
|
||||
class="login-btn"
|
||||
disabled={registerDisabled()}
|
||||
|
||||
Reference in New Issue
Block a user