@refinedev/antd 5.36.18 → 5.37.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.
@@ -30,7 +30,7 @@ import {
30
30
  headStyles,
31
31
  bodyStyles,
32
32
  } from "../styles";
33
- import { ThemedTitle } from "@components";
33
+ import { ThemedTitleV2 } from "@components";
34
34
 
35
35
  const { Text, Title } = Typography;
36
36
  const { useToken } = theme;
@@ -49,6 +49,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
49
49
  renderContent,
50
50
  formProps,
51
51
  title,
52
+ hideForm,
52
53
  }) => {
53
54
  const { token } = useToken();
54
55
  const [form] = Form.useForm<RegisterFormTypes>();
@@ -74,7 +75,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
74
75
  fontSize: "20px",
75
76
  }}
76
77
  >
77
- {title ?? <ThemedTitle collapsed={false} />}
78
+ {title ?? <ThemedTitleV2 collapsed={false} />}
78
79
  </div>
79
80
  );
80
81
 
@@ -118,15 +119,17 @@ export const RegisterPage: React.FC<RegisterProps> = ({
118
119
  </Button>
119
120
  );
120
121
  })}
121
- <Divider>
122
- <Text
123
- style={{
124
- color: token.colorTextLabel,
125
- }}
126
- >
127
- {translate("pages.login.divider", "or")}
128
- </Text>
129
- </Divider>
122
+ {!hideForm && (
123
+ <Divider>
124
+ <Text
125
+ style={{
126
+ color: token.colorTextLabel,
127
+ }}
128
+ >
129
+ {translate("pages.login.divider", "or")}
130
+ </Text>
131
+ </Divider>
132
+ )}
130
133
  </>
131
134
  );
132
135
  }
@@ -145,96 +148,127 @@ export const RegisterPage: React.FC<RegisterProps> = ({
145
148
  {...(contentProps ?? {})}
146
149
  >
147
150
  {renderProviders()}
148
- <Form<RegisterFormTypes>
149
- layout="vertical"
150
- form={form}
151
- onFinish={(values) => register(values)}
152
- requiredMark={false}
153
- {...formProps}
154
- >
155
- <Form.Item
156
- name="email"
157
- label={translate("pages.register.email", "Email")}
158
- rules={[
159
- { required: true },
160
- {
161
- type: "email",
162
- message: translate(
163
- "pages.register.errors.validEmail",
164
- "Invalid email address",
165
- ),
166
- },
167
- ]}
151
+ {!hideForm && (
152
+ <Form<RegisterFormTypes>
153
+ layout="vertical"
154
+ form={form}
155
+ onFinish={(values) => register(values)}
156
+ requiredMark={false}
157
+ {...formProps}
168
158
  >
169
- <Input
170
- size="large"
171
- placeholder={translate(
172
- "pages.register.fields.email",
173
- "Email",
159
+ <Form.Item
160
+ name="email"
161
+ label={translate("pages.register.email", "Email")}
162
+ rules={[
163
+ { required: true },
164
+ {
165
+ type: "email",
166
+ message: translate(
167
+ "pages.register.errors.validEmail",
168
+ "Invalid email address",
169
+ ),
170
+ },
171
+ ]}
172
+ >
173
+ <Input
174
+ size="large"
175
+ placeholder={translate(
176
+ "pages.register.fields.email",
177
+ "Email",
178
+ )}
179
+ />
180
+ </Form.Item>
181
+ <Form.Item
182
+ name="password"
183
+ label={translate(
184
+ "pages.register.fields.password",
185
+ "Password",
174
186
  )}
175
- />
176
- </Form.Item>
177
- <Form.Item
178
- name="password"
179
- label={translate(
180
- "pages.register.fields.password",
181
- "Password",
182
- )}
183
- rules={[{ required: true }]}
184
- >
185
- <Input
186
- type="password"
187
- placeholder="●●●●●●●●"
188
- size="large"
189
- />
190
- </Form.Item>
187
+ rules={[{ required: true }]}
188
+ >
189
+ <Input
190
+ type="password"
191
+ placeholder="●●●●●●●●"
192
+ size="large"
193
+ />
194
+ </Form.Item>
195
+ <div
196
+ style={{
197
+ display: "flex",
198
+ justifyContent: "space-between",
199
+ marginBottom: "24px",
200
+ }}
201
+ >
202
+ {loginLink ?? (
203
+ <Text
204
+ style={{
205
+ fontSize: 12,
206
+ marginLeft: "auto",
207
+ }}
208
+ >
209
+ {translate(
210
+ "pages.login.buttons.haveAccount",
211
+ "Have an account?",
212
+ )}{" "}
213
+ <ActiveLink
214
+ style={{
215
+ fontWeight: "bold",
216
+ color: token.colorPrimaryTextHover,
217
+ }}
218
+ to="/login"
219
+ >
220
+ {translate("pages.login.signin", "Sign in")}
221
+ </ActiveLink>
222
+ </Text>
223
+ )}
224
+ </div>
225
+ <Form.Item
226
+ style={{
227
+ marginBottom: 0,
228
+ }}
229
+ >
230
+ <Button
231
+ type="primary"
232
+ size="large"
233
+ htmlType="submit"
234
+ loading={isLoading}
235
+ block
236
+ >
237
+ {translate(
238
+ "pages.register.buttons.submit",
239
+ "Sign up",
240
+ )}
241
+ </Button>
242
+ </Form.Item>
243
+ </Form>
244
+ )}
245
+ {hideForm && loginLink !== false && (
191
246
  <div
192
247
  style={{
193
- display: "flex",
194
- justifyContent: "space-between",
195
- marginBottom: "24px",
248
+ marginTop: hideForm ? 16 : 8,
196
249
  }}
197
250
  >
198
- {loginLink ?? (
199
- <Text
251
+ <Text
252
+ style={{
253
+ fontSize: 12,
254
+ }}
255
+ >
256
+ {translate(
257
+ "pages.login.buttons.haveAccount",
258
+ "Have an account?",
259
+ )}{" "}
260
+ <ActiveLink
200
261
  style={{
201
- fontSize: 12,
202
- marginLeft: "auto",
262
+ fontWeight: "bold",
263
+ color: token.colorPrimaryTextHover,
203
264
  }}
265
+ to="/login"
204
266
  >
205
- {translate(
206
- "pages.login.buttons.haveAccount",
207
- "Have an account?",
208
- )}{" "}
209
- <ActiveLink
210
- style={{
211
- fontWeight: "bold",
212
- color: token.colorPrimaryTextHover,
213
- }}
214
- to="/login"
215
- >
216
- {translate("pages.login.signin", "Sign in")}
217
- </ActiveLink>
218
- </Text>
219
- )}
267
+ {translate("pages.login.signin", "Sign in")}
268
+ </ActiveLink>
269
+ </Text>
220
270
  </div>
221
-
222
- <Form.Item
223
- style={{
224
- marginBottom: 0,
225
- }}
226
- >
227
- <Button
228
- type="primary"
229
- size="large"
230
- htmlType="submit"
231
- loading={isLoading}
232
- block
233
- >
234
- {translate("pages.register.buttons.submit", "Sign up")}
235
- </Button>
236
- </Form.Item>
237
- </Form>
271
+ )}
238
272
  </Card>
239
273
  );
240
274
 
@@ -242,9 +276,11 @@ export const RegisterPage: React.FC<RegisterProps> = ({
242
276
  <Layout style={layoutStyles} {...(wrapperProps ?? {})}>
243
277
  <Row
244
278
  justify="center"
245
- align="middle"
279
+ align={hideForm ? "top" : "middle"}
246
280
  style={{
247
- height: "100vh",
281
+ padding: "16px 0",
282
+ minHeight: "100dvh",
283
+ paddingTop: hideForm ? "15dvh" : "16px",
248
284
  }}
249
285
  >
250
286
  <Col xs={22}>
@@ -27,7 +27,7 @@ import {
27
27
  headStyles,
28
28
  bodyStyles,
29
29
  } from "../styles";
30
- import { ThemedTitle } from "@components";
30
+ import { ThemedTitleV2 } from "@components";
31
31
 
32
32
  const { Title } = Typography;
33
33
  const { useToken } = theme;
@@ -69,7 +69,7 @@ export const UpdatePasswordPage: React.FC<UpdatePasswordProps> = ({
69
69
  fontSize: "20px",
70
70
  }}
71
71
  >
72
- {title ?? <ThemedTitle collapsed={false} />}
72
+ {title ?? <ThemedTitleV2 collapsed={false} />}
73
73
  </div>
74
74
  );
75
75
 
@@ -184,7 +184,8 @@ export const UpdatePasswordPage: React.FC<UpdatePasswordProps> = ({
184
184
  justify="center"
185
185
  align="middle"
186
186
  style={{
187
- height: "100vh",
187
+ padding: "16px 0",
188
+ minHeight: "100dvh",
188
189
  }}
189
190
  >
190
191
  <Col xs={22}>
@@ -27,7 +27,7 @@ export const UndoableNotification: React.FC<UndoableNotificationProps> = ({
27
27
  type="circle"
28
28
  percent={(undoableTimeout ?? 0) * 20}
29
29
  format={(time) => time && time / 20}
30
- width={50}
30
+ size={50}
31
31
  strokeColor="#1890ff"
32
32
  status="normal"
33
33
  />
@@ -81,7 +81,7 @@ export const useImport = <
81
81
  percent={Math.floor(
82
82
  (processedAmount / totalAmount) * 100,
83
83
  )}
84
- width={50}
84
+ size={50}
85
85
  strokeColor="#1890ff"
86
86
  status="normal"
87
87
  />