Require agreement on signup.
This commit is contained in:
parent
3b76219f18
commit
29f59aa81d
|
@ -19,5 +19,24 @@
|
|||
&-alert {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
&-legal {
|
||||
display: block;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
&-text {
|
||||
font-size: 0.75rem;
|
||||
line-height: 1.2rem;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.ant-form-item-control {
|
||||
line-height: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.PasswordFormItems .ant-row {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Form, Input, Button, Alert } from 'antd';
|
||||
import { Form, Input, Button, Checkbox, Alert } from 'antd';
|
||||
import { FormComponentProps } from 'antd/lib/form';
|
||||
import { authActions } from 'modules/auth';
|
||||
import { AppState } from 'store/reducers';
|
||||
import PasswordFormItems from 'components/PasswordFormItems';
|
||||
import './SignUp.less';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
interface StateProps {
|
||||
isCreatingUser: AppState['auth']['isCreatingUser'];
|
||||
|
@ -67,6 +68,32 @@ class SignUp extends React.Component<Props> {
|
|||
|
||||
<PasswordFormItems form={this.props.form} />
|
||||
|
||||
<Form.Item className="SignUp-form-legal">
|
||||
{getFieldDecorator('hasAgreed', {
|
||||
rules: [
|
||||
{ required: true, message: 'You must agree to create an account' },
|
||||
],
|
||||
})(
|
||||
<Checkbox name="hasAgreed">
|
||||
<span className="SignUp-form-legal-text">
|
||||
I agree to the{' '}
|
||||
<Link target="_blank" to="/code-of-conduct">
|
||||
code of conduct
|
||||
</Link>
|
||||
,{' '}
|
||||
<Link target="_blank" to="/tos">
|
||||
terms of service
|
||||
</Link>
|
||||
, and{' '}
|
||||
<Link target="_blank" to="/privacy">
|
||||
privacy policy
|
||||
</Link>
|
||||
.
|
||||
</span>
|
||||
</Checkbox>,
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<div className="SignUp-form-controls">
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
Loading…
Reference in New Issue