Restructure host signup terms dialog documents config and dialog

pull/21833/head
Jason Robinson 2021-02-09 12:23:27 +02:00
parent 3ed6f1fe5d
commit e31b89b952
2 changed files with 26 additions and 4 deletions

View File

@ -168,12 +168,32 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
} }
private onAccountDetailsRequest = () => { private onAccountDetailsRequest = () => {
const termsDialog = this.config.termsDialog;
const textComponent = (
<>
<p>
{termsDialog.text}
</p>
<p>
{_t("Learn more in our")}&nbsp;
<a href={termsDialog.privacyPolicy.href} target="_blank" rel="noreferrer noopener">
{termsDialog.privacyPolicy.text}
</a>,&nbsp;
<a href={termsDialog.termsOfService.href} target="_blank" rel="noreferrer noopener">
{termsDialog.termsOfService.text}
</a> {_t("and")}&nbsp;
<a href={termsDialog.cookiePolicy.href} target="_blank" rel="noreferrer noopener">
{termsDialog.cookiePolicy.text}
</a>.
</p>
</>
);
Modal.createDialog( Modal.createDialog(
QuestionDialog, QuestionDialog,
{ {
title: this.config.termsDialog.title, title: termsDialog.title,
description: this.config.termsDialog.text, description: textComponent,
button: this.config.termsDialog.acceptText, button: termsDialog.acceptText,
onFinished: this.onAccountDetailsDialogFinished, onFinished: this.onAccountDetailsDialogFinished,
}, },
); );

View File

@ -53,7 +53,9 @@ interface ILink {
interface IHostSignupTermsDialogConfig { interface IHostSignupTermsDialogConfig {
acceptText: string; acceptText: string;
termsDocuments: Array<ILink>; cookiePolicy: ILink;
privacyPolicy: ILink;
termsOfService: ILink;
text: string; text: string;
title: string; title: string;
} }