From fa2b61768162494ece135ca5842fe914c7fab4ec Mon Sep 17 00:00:00 2001
From: Jagger <634750802@qq.com>
Date: Wed, 10 Nov 2021 14:34:22 +0800
Subject: [PATCH] feat: add use terms in register page
---
packages/accounts/src/app.css | 4 +++
packages/accounts/src/components/links.js | 1 +
.../src/pages/register/index.page.jsx | 36 ++++++++++---------
.../src/pages/register/register.form.js | 4 +++
4 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/packages/accounts/src/app.css b/packages/accounts/src/app.css
index 0ea1511ed..14e9b0118 100644
--- a/packages/accounts/src/app.css
+++ b/packages/accounts/src/app.css
@@ -11,3 +11,7 @@ body {
#app {
min-height: 100vh;
}
+
+.no-wrap {
+ white-space: nowrap;
+}
diff --git a/packages/accounts/src/components/links.js b/packages/accounts/src/components/links.js
index 3e1d15c47..56751b73d 100644
--- a/packages/accounts/src/components/links.js
+++ b/packages/accounts/src/components/links.js
@@ -4,6 +4,7 @@ import { colors } from '@tidb-community/ui';
export const RouteLink = styled(Link)`
color: #aaa;
+ //white-space: nowrap;
&:hover {
color: ${colors.B1};
diff --git a/packages/accounts/src/pages/register/index.page.jsx b/packages/accounts/src/pages/register/index.page.jsx
index 8767faec6..e422b65b0 100644
--- a/packages/accounts/src/pages/register/index.page.jsx
+++ b/packages/accounts/src/pages/register/index.page.jsx
@@ -1,16 +1,15 @@
import React from 'react';
-import { Checkbox, Form, FormItem, Input, AutoComplete } from 'formik-antd';
+import { AutoComplete, Checkbox, Form, FormItem, Input } from 'formik-antd';
import { Formik } from 'formik';
-import { Link, withVerifyCode, RemoteAutoComplete } from '@tidb-community/ui';
+import { Link, RemoteAutoComplete, withVerifyCode } from '@tidb-community/ui';
import { parse } from 'querystring';
import { useLocation } from 'react-router-dom';
import { utils } from '@tidb-community/common';
-import { Flex } from '~/components/layout';
import { RouteLink } from '~/components/links';
import { SimpleLayout } from '~/layout';
-import { SubmitButton, PhoneInputPrefix } from '~/components/form';
-import { signup as callSignup, fetchOrganizationOptions } from '~/api';
+import { PhoneInputPrefix, SubmitButton } from '~/components/form';
+import { fetchOrganizationOptions, signup as callSignup } from '~/api';
import { form, formSchema, initialValues } from './register.form';
import { handleError } from '~/utils/errors';
@@ -19,7 +18,7 @@ const { wrapFormikSubmitFunction } = utils.form;
const VerifyInput = withVerifyCode(Input);
-const { privacy, prefixText: agreementsPrefixText, ...agreementsProps } = agreements;
+const { privacy, terms, prefixText: agreementsPrefixText, ...agreementsProps } = agreements;
const Page = () => {
const location = useLocation();
@@ -60,17 +59,20 @@ const Page = () => {
size="large"
/>
-
-
-
- {agreementsPrefixText}
- {privacy.title}
-
-
-
- 已有账号?去登录
-
-
+
+
+ {agreementsPrefixText}
+
+ {privacy.title}
+
+
+ {terms.title}
+
+
+
+
+ 已有账号?去登录
+
注册
)}
diff --git a/packages/accounts/src/pages/register/register.form.js b/packages/accounts/src/pages/register/register.form.js
index 7aad9cfa7..0f149cecb 100644
--- a/packages/accounts/src/pages/register/register.form.js
+++ b/packages/accounts/src/pages/register/register.form.js
@@ -22,6 +22,10 @@ export const form = {
title: '《隐私协议》',
url: 'https://pingcap.com/zh/privacy-policy/',
},
+ terms: {
+ title: '《使用条款》',
+ url: 'https://pingcap.com/zh/terms-of-use',
+ },
validator: Yup.bool().oneOf([true], '需阅读并同意相关协议').required('需阅读并同意相关协议'),
initialValue: false,
},