@refinedev/antd 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/dist/components/buttons/create/index.d.ts.map +1 -1
- package/dist/components/crud/show/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/forgotPassword/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/login/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/register/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/styles.d.ts +2 -0
- package/dist/components/pages/auth/components/styles.d.ts.map +1 -1
- package/dist/components/pages/auth/components/updatePassword/index.d.ts.map +1 -1
- package/dist/components/pages/auth/index.d.ts +4 -1
- package/dist/components/pages/auth/index.d.ts.map +1 -1
- package/dist/components/themedLayout/header/index.d.ts +4 -0
- package/dist/components/themedLayout/header/index.d.ts.map +1 -0
- package/dist/components/themedLayout/index.d.ts +4 -0
- package/dist/components/themedLayout/index.d.ts.map +1 -0
- package/dist/components/themedLayout/sider/index.d.ts +4 -0
- package/dist/components/themedLayout/sider/index.d.ts.map +1 -0
- package/dist/components/themedLayout/sider/styles.d.ts +3 -0
- package/dist/components/themedLayout/sider/styles.d.ts.map +1 -0
- package/dist/components/themedLayout/title/index.d.ts +4 -0
- package/dist/components/themedLayout/title/index.d.ts.map +1 -0
- package/dist/components/themedLayout/types.d.ts +3 -0
- package/dist/components/themedLayout/types.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +1 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/themes/index.d.ts +6 -0
- package/dist/definitions/themes/index.d.ts.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/iife/index.js +4 -4
- package/dist/iife/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/refine.config.js +96 -0
- package/src/components/buttons/create/index.tsx +1 -0
- package/src/components/crud/show/index.tsx +1 -0
- package/src/components/index.ts +6 -0
- package/src/components/pages/auth/components/forgotPassword/index.tsx +53 -7
- package/src/components/pages/auth/components/login/index.tsx +61 -10
- package/src/components/pages/auth/components/register/index.tsx +63 -11
- package/src/components/pages/auth/components/styles.ts +14 -7
- package/src/components/pages/auth/components/updatePassword/index.tsx +51 -7
- package/src/components/pages/auth/index.tsx +7 -1
- package/src/components/themedLayout/header/index.tsx +44 -0
- package/src/components/themedLayout/index.tsx +41 -0
- package/src/components/themedLayout/sider/index.tsx +296 -0
- package/src/components/themedLayout/sider/styles.ts +9 -0
- package/src/components/themedLayout/title/index.tsx +81 -0
- package/src/components/themedLayout/types.ts +13 -0
- package/src/definitions/index.ts +1 -0
- package/src/definitions/themes/index.ts +50 -0
- package/src/index.tsx +2 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@refinedev/antd",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.2.0",
|
4
4
|
"description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
|
5
5
|
"private": false,
|
6
6
|
"main": "dist/index.js",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"@refinedev/cli": "^2.1.0",
|
27
|
-
"@refinedev/ui-tests": "^1.
|
28
|
-
"@refinedev/core": "^4.
|
27
|
+
"@refinedev/ui-tests": "^1.2.0",
|
28
|
+
"@refinedev/core": "^4.4.0",
|
29
29
|
"@esbuild-plugins/node-resolve": "^0.1.4",
|
30
30
|
"@testing-library/jest-dom": "^5.16.4",
|
31
31
|
"@testing-library/react": "^13.1.1",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"dependencies": {
|
50
50
|
"@ant-design/icons": "^5.0.1",
|
51
51
|
"@ant-design/pro-layout": "7.8.3",
|
52
|
-
"@refinedev/ui-types": "^1.
|
52
|
+
"@refinedev/ui-types": "^1.2.0",
|
53
53
|
"@tanstack/react-query": "^4.10.1",
|
54
54
|
"antd": "^5.0.5",
|
55
55
|
"dayjs": "^1.10.7",
|
package/refine.config.js
CHANGED
@@ -558,6 +558,102 @@ module.exports = {
|
|
558
558
|
},
|
559
559
|
],
|
560
560
|
},
|
561
|
+
{
|
562
|
+
group: "Other",
|
563
|
+
label: "Themed Layout",
|
564
|
+
message: `
|
565
|
+
**\`Warning:\`**
|
566
|
+
If you want to change the default layout;
|
567
|
+
You should pass layout related components to the **<ThemedLayout/>** component's props.
|
568
|
+
|
569
|
+
\`\`\`
|
570
|
+
// title: App.tsx
|
571
|
+
import { ThemedLayout } from "components/themedLayout";
|
572
|
+
import { ThemedHeader } from "components/themedLayout/header";
|
573
|
+
import { ThemedSider } from "components/themedLayout/sider";
|
574
|
+
import { ThemedTitle } from "components/themedLayout/title";
|
575
|
+
|
576
|
+
const App = () => {
|
577
|
+
return (
|
578
|
+
<Refine
|
579
|
+
/* ... */
|
580
|
+
>
|
581
|
+
<ThemedLayout Header={ThemedHeader} Sider={ThemedSider} Title={ThemedTitle} />
|
582
|
+
/* ... */
|
583
|
+
</ThemedLayout>
|
584
|
+
</Refine>
|
585
|
+
);
|
586
|
+
}
|
587
|
+
\`\`\`
|
588
|
+
`,
|
589
|
+
files: [
|
590
|
+
{
|
591
|
+
src: "./src/components/themedLayout/sider/index.tsx",
|
592
|
+
dest: "./components/themedLayout/sider.tsx",
|
593
|
+
transform: (content) => {
|
594
|
+
let newContent = content;
|
595
|
+
const imports = getImports(content);
|
596
|
+
|
597
|
+
imports.map((importItem) => {
|
598
|
+
// handle @components import replacement
|
599
|
+
if (importItem.importPath === "@components") {
|
600
|
+
const newStatement = `import ${importItem.namedImports} from "@refinedev/antd";`;
|
601
|
+
|
602
|
+
newContent = newContent.replace(
|
603
|
+
importItem.statement,
|
604
|
+
newStatement,
|
605
|
+
);
|
606
|
+
}
|
607
|
+
|
608
|
+
// add content of ./styles.ts and remove import
|
609
|
+
if (importItem.importPath === "./styles") {
|
610
|
+
newContent = newContent.replace(
|
611
|
+
importItem.statement,
|
612
|
+
"",
|
613
|
+
);
|
614
|
+
|
615
|
+
let appending = "";
|
616
|
+
|
617
|
+
try {
|
618
|
+
const stylesContent = getFileContent(
|
619
|
+
join(
|
620
|
+
dirname(
|
621
|
+
"./src/components/themedLayout/sider/index.tsx",
|
622
|
+
),
|
623
|
+
"/styles.ts",
|
624
|
+
),
|
625
|
+
"utf-8",
|
626
|
+
).replace("export const", "const");
|
627
|
+
|
628
|
+
appending = stylesContent;
|
629
|
+
} catch (err) {
|
630
|
+
// console.log(err);
|
631
|
+
}
|
632
|
+
|
633
|
+
newContent = appendAfterImports(
|
634
|
+
newContent,
|
635
|
+
appending,
|
636
|
+
);
|
637
|
+
}
|
638
|
+
});
|
639
|
+
|
640
|
+
return newContent;
|
641
|
+
},
|
642
|
+
},
|
643
|
+
{
|
644
|
+
src: "./src/components/themedLayout/header/index.tsx",
|
645
|
+
dest: "./components/themedLayout/header.tsx",
|
646
|
+
},
|
647
|
+
{
|
648
|
+
src: "./src/components/themedLayout/title/index.tsx",
|
649
|
+
dest: "./components/themedLayout/title.tsx",
|
650
|
+
},
|
651
|
+
{
|
652
|
+
src: "./src/components/themedLayout/index.tsx",
|
653
|
+
dest: "./components/themedLayout/index.tsx",
|
654
|
+
},
|
655
|
+
],
|
656
|
+
},
|
561
657
|
],
|
562
658
|
transform: (content) => {
|
563
659
|
let newContent = content;
|
package/src/components/index.ts
CHANGED
@@ -5,6 +5,12 @@ export { Sider } from "./layout/sider";
|
|
5
5
|
export { Title } from "./layout/title";
|
6
6
|
export * from "./layout/types";
|
7
7
|
|
8
|
+
export { ThemedLayout } from "./themedLayout";
|
9
|
+
export { ThemedHeader } from "./themedLayout/header";
|
10
|
+
export { ThemedSider } from "./themedLayout/sider";
|
11
|
+
export { ThemedTitle } from "./themedLayout/title";
|
12
|
+
export * from "./themedLayout/types";
|
13
|
+
|
8
14
|
export * from "./buttons";
|
9
15
|
export * from "./crud";
|
10
16
|
export * from "./fields";
|
@@ -17,6 +17,7 @@ import {
|
|
17
17
|
LayoutProps,
|
18
18
|
CardProps,
|
19
19
|
FormProps,
|
20
|
+
theme,
|
20
21
|
} from "antd";
|
21
22
|
import {
|
22
23
|
useTranslate,
|
@@ -24,7 +25,14 @@ import {
|
|
24
25
|
useForgotPassword,
|
25
26
|
} from "@refinedev/core";
|
26
27
|
|
27
|
-
import {
|
28
|
+
import {
|
29
|
+
layoutStyles,
|
30
|
+
containerStyles,
|
31
|
+
titleStyles,
|
32
|
+
headStyles,
|
33
|
+
bodyStyles,
|
34
|
+
} from "../styles";
|
35
|
+
import { ThemedTitle } from "@components";
|
28
36
|
|
29
37
|
type ResetPassworProps = ForgotPasswordPageProps<
|
30
38
|
LayoutProps,
|
@@ -33,6 +41,7 @@ type ResetPassworProps = ForgotPasswordPageProps<
|
|
33
41
|
>;
|
34
42
|
|
35
43
|
const { Text, Title } = Typography;
|
44
|
+
const { useToken } = theme;
|
36
45
|
|
37
46
|
/**
|
38
47
|
* **refine** has forgot password page form which is served on `/forgot-password` route when the `authProvider` configuration is provided.
|
@@ -45,7 +54,9 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
45
54
|
contentProps,
|
46
55
|
renderContent,
|
47
56
|
formProps,
|
57
|
+
title,
|
48
58
|
}) => {
|
59
|
+
const { token } = useToken();
|
49
60
|
const [form] = Form.useForm<ForgotPasswordFormTypes>();
|
50
61
|
const translate = useTranslate();
|
51
62
|
const routerType = useRouterType();
|
@@ -57,16 +68,39 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
57
68
|
const { mutate: forgotPassword, isLoading } =
|
58
69
|
useForgotPassword<ForgotPasswordFormTypes>();
|
59
70
|
|
71
|
+
const PageTitle =
|
72
|
+
title === false ? null : (
|
73
|
+
<div
|
74
|
+
style={{
|
75
|
+
display: "flex",
|
76
|
+
justifyContent: "center",
|
77
|
+
marginBottom: "32px",
|
78
|
+
}}
|
79
|
+
>
|
80
|
+
{title ?? <ThemedTitle collapsed={false} />}
|
81
|
+
</div>
|
82
|
+
);
|
83
|
+
|
60
84
|
const CardTitle = (
|
61
|
-
<Title
|
85
|
+
<Title
|
86
|
+
level={3}
|
87
|
+
style={{
|
88
|
+
color: token.colorPrimaryTextHover,
|
89
|
+
...titleStyles,
|
90
|
+
}}
|
91
|
+
>
|
62
92
|
{translate("pages.forgotPassword.title", "Forgot your password?")}
|
63
93
|
</Title>
|
64
94
|
);
|
65
95
|
const CardContent = (
|
66
96
|
<Card
|
67
97
|
title={CardTitle}
|
68
|
-
headStyle={
|
69
|
-
|
98
|
+
headStyle={headStyles}
|
99
|
+
bodyStyle={bodyStyles}
|
100
|
+
style={{
|
101
|
+
...containerStyles,
|
102
|
+
backgroundColor: token.colorBgElevated,
|
103
|
+
}}
|
70
104
|
{...(contentProps ?? {})}
|
71
105
|
>
|
72
106
|
<Form<ForgotPasswordFormTypes>
|
@@ -106,7 +140,6 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
106
140
|
style={{
|
107
141
|
display: "flex",
|
108
142
|
justifyContent: "space-between",
|
109
|
-
marginBottom: "12px",
|
110
143
|
}}
|
111
144
|
>
|
112
145
|
{loginLink ?? (
|
@@ -123,6 +156,7 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
123
156
|
<ActiveLink
|
124
157
|
style={{
|
125
158
|
fontWeight: "bold",
|
159
|
+
color: token.colorPrimaryTextHover,
|
126
160
|
}}
|
127
161
|
to="/login"
|
128
162
|
>
|
@@ -131,7 +165,12 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
131
165
|
</Text>
|
132
166
|
)}
|
133
167
|
</div>
|
134
|
-
<Form.Item
|
168
|
+
<Form.Item
|
169
|
+
style={{
|
170
|
+
marginTop: "24px",
|
171
|
+
marginBottom: 0,
|
172
|
+
}}
|
173
|
+
>
|
135
174
|
<Button
|
136
175
|
type="primary"
|
137
176
|
size="large"
|
@@ -159,7 +198,14 @@ export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
|
|
159
198
|
}}
|
160
199
|
>
|
161
200
|
<Col xs={22}>
|
162
|
-
{renderContent ?
|
201
|
+
{renderContent ? (
|
202
|
+
renderContent(CardContent, PageTitle)
|
203
|
+
) : (
|
204
|
+
<>
|
205
|
+
{PageTitle}
|
206
|
+
{CardContent}
|
207
|
+
</>
|
208
|
+
)}
|
163
209
|
</Col>
|
164
210
|
</Row>
|
165
211
|
</Layout>
|
@@ -20,15 +20,23 @@ import {
|
|
20
20
|
LayoutProps,
|
21
21
|
Divider,
|
22
22
|
FormProps,
|
23
|
+
theme,
|
23
24
|
} from "antd";
|
24
25
|
import { useLogin, useTranslate, useRouterContext } from "@refinedev/core";
|
25
26
|
|
26
|
-
import {
|
27
|
+
import {
|
28
|
+
bodyStyles,
|
29
|
+
containerStyles,
|
30
|
+
headStyles,
|
31
|
+
layoutStyles,
|
32
|
+
titleStyles,
|
33
|
+
} from "../styles";
|
34
|
+
import { ThemedTitle } from "@components";
|
27
35
|
|
28
36
|
const { Text, Title } = Typography;
|
37
|
+
const { useToken } = theme;
|
29
38
|
|
30
39
|
type LoginProps = LoginPageProps<LayoutProps, CardProps, FormProps>;
|
31
|
-
|
32
40
|
/**
|
33
41
|
* **refine** has a default login page form which is served on `/login` route when the `authProvider` configuration is provided.
|
34
42
|
*
|
@@ -43,7 +51,9 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
43
51
|
wrapperProps,
|
44
52
|
renderContent,
|
45
53
|
formProps,
|
54
|
+
title,
|
46
55
|
}) => {
|
56
|
+
const { token } = useToken();
|
47
57
|
const [form] = Form.useForm<LoginFormTypes>();
|
48
58
|
const translate = useTranslate();
|
49
59
|
const routerType = useRouterType();
|
@@ -57,8 +67,27 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
57
67
|
v3LegacyAuthProviderCompatible: Boolean(authProvider?.isLegacy),
|
58
68
|
});
|
59
69
|
|
70
|
+
const PageTitle =
|
71
|
+
title === false ? null : (
|
72
|
+
<div
|
73
|
+
style={{
|
74
|
+
display: "flex",
|
75
|
+
justifyContent: "center",
|
76
|
+
marginBottom: "32px",
|
77
|
+
}}
|
78
|
+
>
|
79
|
+
{title ?? <ThemedTitle collapsed={false} />}
|
80
|
+
</div>
|
81
|
+
);
|
82
|
+
|
60
83
|
const CardTitle = (
|
61
|
-
<Title
|
84
|
+
<Title
|
85
|
+
level={3}
|
86
|
+
style={{
|
87
|
+
color: token.colorPrimaryTextHover,
|
88
|
+
...titleStyles,
|
89
|
+
}}
|
90
|
+
>
|
62
91
|
{translate("pages.login.title", "Sign in to your account")}
|
63
92
|
</Title>
|
64
93
|
);
|
@@ -91,7 +120,15 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
91
120
|
</Button>
|
92
121
|
);
|
93
122
|
})}
|
94
|
-
<Divider>
|
123
|
+
<Divider>
|
124
|
+
<Text
|
125
|
+
style={{
|
126
|
+
color: token.colorTextLabel,
|
127
|
+
}}
|
128
|
+
>
|
129
|
+
{translate("pages.login.divider", "or")}
|
130
|
+
</Text>
|
131
|
+
</Divider>
|
95
132
|
</>
|
96
133
|
);
|
97
134
|
}
|
@@ -101,8 +138,12 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
101
138
|
const CardContent = (
|
102
139
|
<Card
|
103
140
|
title={CardTitle}
|
104
|
-
headStyle={
|
105
|
-
|
141
|
+
headStyle={headStyles}
|
142
|
+
bodyStyle={bodyStyles}
|
143
|
+
style={{
|
144
|
+
...containerStyles,
|
145
|
+
backgroundColor: token.colorBgElevated,
|
146
|
+
}}
|
106
147
|
{...(contentProps ?? {})}
|
107
148
|
>
|
108
149
|
{renderProviders()}
|
@@ -142,7 +183,6 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
142
183
|
name="password"
|
143
184
|
label={translate("pages.login.fields.password", "Password")}
|
144
185
|
rules={[{ required: true }]}
|
145
|
-
style={{ marginBottom: "12px" }}
|
146
186
|
>
|
147
187
|
<Input
|
148
188
|
type="password"
|
@@ -154,7 +194,7 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
154
194
|
style={{
|
155
195
|
display: "flex",
|
156
196
|
justifyContent: "space-between",
|
157
|
-
marginBottom: "
|
197
|
+
marginBottom: "24px",
|
158
198
|
}}
|
159
199
|
>
|
160
200
|
{rememberMe ?? (
|
@@ -178,6 +218,7 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
178
218
|
{forgotPasswordLink ?? (
|
179
219
|
<ActiveLink
|
180
220
|
style={{
|
221
|
+
color: token.colorPrimaryTextHover,
|
181
222
|
fontSize: "12px",
|
182
223
|
marginLeft: "auto",
|
183
224
|
}}
|
@@ -211,7 +252,10 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
211
252
|
)}{" "}
|
212
253
|
<ActiveLink
|
213
254
|
to="/register"
|
214
|
-
style={{
|
255
|
+
style={{
|
256
|
+
fontWeight: "bold",
|
257
|
+
color: token.colorPrimaryTextHover,
|
258
|
+
}}
|
215
259
|
>
|
216
260
|
{translate("pages.login.signup", "Sign up")}
|
217
261
|
</ActiveLink>
|
@@ -231,7 +275,14 @@ export const LoginPage: React.FC<LoginProps> = ({
|
|
231
275
|
}}
|
232
276
|
>
|
233
277
|
<Col xs={22}>
|
234
|
-
{renderContent ?
|
278
|
+
{renderContent ? (
|
279
|
+
renderContent(CardContent, PageTitle)
|
280
|
+
) : (
|
281
|
+
<>
|
282
|
+
{PageTitle}
|
283
|
+
{CardContent}
|
284
|
+
</>
|
285
|
+
)}
|
235
286
|
</Col>
|
236
287
|
</Row>
|
237
288
|
</Layout>
|
@@ -19,15 +19,23 @@ import {
|
|
19
19
|
CardProps,
|
20
20
|
FormProps,
|
21
21
|
Divider,
|
22
|
+
theme,
|
22
23
|
} from "antd";
|
23
24
|
import { useTranslate, useRouterContext, useRegister } from "@refinedev/core";
|
24
25
|
|
25
|
-
import {
|
26
|
+
import {
|
27
|
+
layoutStyles,
|
28
|
+
containerStyles,
|
29
|
+
titleStyles,
|
30
|
+
headStyles,
|
31
|
+
bodyStyles,
|
32
|
+
} from "../styles";
|
33
|
+
import { ThemedTitle } from "@components";
|
26
34
|
|
27
35
|
const { Text, Title } = Typography;
|
36
|
+
const { useToken } = theme;
|
28
37
|
|
29
38
|
type RegisterProps = RegisterPageProps<LayoutProps, CardProps, FormProps>;
|
30
|
-
|
31
39
|
/**
|
32
40
|
* **refine** has register page form which is served on `/register` route when the `authProvider` configuration is provided.
|
33
41
|
*
|
@@ -40,7 +48,9 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
40
48
|
contentProps,
|
41
49
|
renderContent,
|
42
50
|
formProps,
|
51
|
+
title,
|
43
52
|
}) => {
|
53
|
+
const { token } = useToken();
|
44
54
|
const [form] = Form.useForm<RegisterFormTypes>();
|
45
55
|
const translate = useTranslate();
|
46
56
|
const routerType = useRouterType();
|
@@ -54,8 +64,27 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
54
64
|
v3LegacyAuthProviderCompatible: Boolean(authProvider?.isLegacy),
|
55
65
|
});
|
56
66
|
|
67
|
+
const PageTitle =
|
68
|
+
title === false ? null : (
|
69
|
+
<div
|
70
|
+
style={{
|
71
|
+
display: "flex",
|
72
|
+
justifyContent: "center",
|
73
|
+
marginBottom: "32px",
|
74
|
+
}}
|
75
|
+
>
|
76
|
+
{title ?? <ThemedTitle collapsed={false} />}
|
77
|
+
</div>
|
78
|
+
);
|
79
|
+
|
57
80
|
const CardTitle = (
|
58
|
-
<Title
|
81
|
+
<Title
|
82
|
+
level={3}
|
83
|
+
style={{
|
84
|
+
color: token.colorPrimaryTextHover,
|
85
|
+
...titleStyles,
|
86
|
+
}}
|
87
|
+
>
|
59
88
|
{translate("pages.register.title", "Sign up for your account")}
|
60
89
|
</Title>
|
61
90
|
);
|
@@ -68,7 +97,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
68
97
|
return (
|
69
98
|
<Button
|
70
99
|
key={provider.name}
|
71
|
-
type="
|
100
|
+
type="default"
|
72
101
|
block
|
73
102
|
icon={provider.icon}
|
74
103
|
style={{
|
@@ -88,7 +117,15 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
88
117
|
</Button>
|
89
118
|
);
|
90
119
|
})}
|
91
|
-
<Divider>
|
120
|
+
<Divider>
|
121
|
+
<Text
|
122
|
+
style={{
|
123
|
+
color: token.colorTextLabel,
|
124
|
+
}}
|
125
|
+
>
|
126
|
+
{translate("pages.login.divider", "or")}
|
127
|
+
</Text>
|
128
|
+
</Divider>
|
92
129
|
</>
|
93
130
|
);
|
94
131
|
}
|
@@ -98,8 +135,12 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
98
135
|
const CardContent = (
|
99
136
|
<Card
|
100
137
|
title={CardTitle}
|
101
|
-
headStyle={
|
102
|
-
|
138
|
+
headStyle={headStyles}
|
139
|
+
bodyStyle={bodyStyles}
|
140
|
+
style={{
|
141
|
+
...containerStyles,
|
142
|
+
backgroundColor: token.colorBgElevated,
|
143
|
+
}}
|
103
144
|
{...(contentProps ?? {})}
|
104
145
|
>
|
105
146
|
{renderProviders()}
|
@@ -139,7 +180,6 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
139
180
|
"Password",
|
140
181
|
)}
|
141
182
|
rules={[{ required: true }]}
|
142
|
-
style={{ marginBottom: "12px" }}
|
143
183
|
>
|
144
184
|
<Input
|
145
185
|
type="password"
|
@@ -151,7 +191,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
151
191
|
style={{
|
152
192
|
display: "flex",
|
153
193
|
justifyContent: "space-between",
|
154
|
-
marginBottom: "
|
194
|
+
marginBottom: "24px",
|
155
195
|
}}
|
156
196
|
>
|
157
197
|
{loginLink ?? (
|
@@ -168,6 +208,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
168
208
|
<ActiveLink
|
169
209
|
style={{
|
170
210
|
fontWeight: "bold",
|
211
|
+
color: token.colorPrimaryTextHover,
|
171
212
|
}}
|
172
213
|
to="/login"
|
173
214
|
>
|
@@ -177,7 +218,11 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
177
218
|
)}
|
178
219
|
</div>
|
179
220
|
|
180
|
-
<Form.Item
|
221
|
+
<Form.Item
|
222
|
+
style={{
|
223
|
+
marginBottom: 0,
|
224
|
+
}}
|
225
|
+
>
|
181
226
|
<Button
|
182
227
|
type="primary"
|
183
228
|
size="large"
|
@@ -202,7 +247,14 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
202
247
|
}}
|
203
248
|
>
|
204
249
|
<Col xs={22}>
|
205
|
-
{renderContent ?
|
250
|
+
{renderContent ? (
|
251
|
+
renderContent(CardContent, PageTitle)
|
252
|
+
) : (
|
253
|
+
<>
|
254
|
+
{PageTitle}
|
255
|
+
{CardContent}
|
256
|
+
</>
|
257
|
+
)}
|
206
258
|
</Col>
|
207
259
|
</Row>
|
208
260
|
</Layout>
|
@@ -1,21 +1,28 @@
|
|
1
1
|
import { CSSProperties } from "react";
|
2
2
|
|
3
|
-
export const layoutStyles: CSSProperties = {
|
4
|
-
background: `radial-gradient(50% 50% at 50% 50%, #6813CB 0%, #2A2A42 100%)`,
|
5
|
-
backgroundSize: "cover",
|
6
|
-
};
|
3
|
+
export const layoutStyles: CSSProperties = {};
|
7
4
|
|
8
5
|
export const containerStyles: CSSProperties = {
|
9
|
-
maxWidth: "
|
6
|
+
maxWidth: "400px",
|
10
7
|
margin: "auto",
|
8
|
+
padding: "32px",
|
9
|
+
boxShadow:
|
10
|
+
"0px 2px 4px rgba(0, 0, 0, 0.02), 0px 1px 6px -1px rgba(0, 0, 0, 0.02), 0px 1px 2px rgba(0, 0, 0, 0.03)",
|
11
|
+
};
|
12
|
+
|
13
|
+
export const headStyles: CSSProperties = {
|
14
|
+
borderBottom: 0,
|
15
|
+
padding: 0,
|
11
16
|
};
|
12
17
|
|
18
|
+
export const bodyStyles: CSSProperties = { padding: 0, marginTop: "32px" };
|
19
|
+
|
13
20
|
export const titleStyles: CSSProperties = {
|
14
21
|
textAlign: "center",
|
15
|
-
color: "#626262",
|
16
22
|
marginBottom: 0,
|
17
23
|
fontSize: "24px",
|
18
|
-
|
24
|
+
lineHeight: "32px",
|
25
|
+
fontWeight: 700,
|
19
26
|
overflowWrap: "break-word",
|
20
27
|
hyphens: "manual",
|
21
28
|
textOverflow: "unset",
|