mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Add app's TermsOfUse.
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import {Link} from "react-router-dom";
|
||||
import {Form, Input, Checkbox, Button, Row, Col, Result} from 'antd';
|
||||
import {Form, Input, Checkbox, Button, Row, Col, Result, Modal} from 'antd';
|
||||
import * as Setting from "../Setting";
|
||||
import * as AuthBackend from "./AuthBackend";
|
||||
import i18next from "i18next";
|
||||
@ -71,6 +71,7 @@ class SignupPage extends React.Component {
|
||||
validEmail: false,
|
||||
validPhone: false,
|
||||
region: "",
|
||||
isTermsOfUseVisible: false,
|
||||
};
|
||||
|
||||
this.form = React.createRef();
|
||||
@ -388,7 +389,11 @@ class SignupPage extends React.Component {
|
||||
>
|
||||
<Checkbox>
|
||||
{i18next.t("signup:Accept")}
|
||||
<Link to={"/agreement"}>
|
||||
<Link onClick={() => {
|
||||
this.setState({
|
||||
isTermsOfUseVisible: true,
|
||||
});
|
||||
}}>
|
||||
{i18next.t("signup:Terms of Use")}
|
||||
</Link>
|
||||
</Checkbox>
|
||||
@ -397,6 +402,32 @@ class SignupPage extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
renderModal() {
|
||||
return (
|
||||
<Modal
|
||||
title={i18next.t("signup:Terms of Use")}
|
||||
visible={this.state.isTermsOfUseVisible}
|
||||
closable={false}
|
||||
footer={[
|
||||
<Button key="agree" type="primary" onClick={() => {
|
||||
this.setState({
|
||||
isTermsOfUseVisible: false,
|
||||
});
|
||||
}}>
|
||||
{i18next.t("user:OK")}
|
||||
</Button>,
|
||||
// <Button key="decline" onClick={() => {
|
||||
// this.props.history.goBack();
|
||||
// }}>
|
||||
// {i18next.t("signup:Decline")}
|
||||
// </Button>,
|
||||
]}
|
||||
>
|
||||
<div dangerouslySetInnerHTML={{__html: this.state.application.termsOfUse}} />
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
renderForm(application) {
|
||||
if (!application.enableSignUp) {
|
||||
return (
|
||||
@ -493,6 +524,9 @@ class SignupPage extends React.Component {
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
{
|
||||
this.renderModal()
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user