form-craft-package 1.7.7 → 1.7.9-dev.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/package.json +1 -1
- package/src/components/companies/2-unauthenticated/forgot-password.tsx +62 -31
- package/src/components/companies/2-unauthenticated/index.tsx +1 -0
- package/src/components/form/layout-renderer/1-row/header-render.tsx +1 -1
- package/src/types/companies/site-layout/authenticated/index.tsx +18 -16
package/package.json
CHANGED
|
@@ -1,44 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button, Col, Form, Input, Row, Spin } from 'antd'
|
|
2
2
|
import { useNavigate } from 'react-router-dom'
|
|
3
3
|
import { useLoginHandler } from '../../common/custom-hooks/use-login-handler'
|
|
4
|
+
import { useConfigContext } from '../context'
|
|
4
5
|
|
|
5
6
|
export const ForgotPassword = () => {
|
|
7
|
+
const { config } = useConfigContext()
|
|
6
8
|
const navigate = useNavigate()
|
|
7
9
|
const { handleForgotPassword } = useLoginHandler()
|
|
10
|
+
|
|
11
|
+
const formPadding = config?.loginLayout?.form?.padding
|
|
12
|
+
const titleColor = config?.loginLayout.form.color
|
|
13
|
+
const background = config?.loginLayout?.background
|
|
14
|
+
const logoUrl = config?.siteIdentity?.logoUrl
|
|
15
|
+
const primaryColor = config?.siteLayout?.siteConfigs?.colors?.primary
|
|
16
|
+
|
|
8
17
|
return (
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
<Spin spinning={false}>
|
|
19
|
+
<div className="h-screen w-full flex items-center justify-center overflow-hidden" style={{ background }}>
|
|
20
|
+
<div
|
|
21
|
+
className="overflow-auto text-center shadow"
|
|
22
|
+
style={{
|
|
23
|
+
padding: formPadding,
|
|
24
|
+
background: '#fff',
|
|
25
|
+
width: 400,
|
|
26
|
+
maxWidth: '100%',
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{logoUrl && (
|
|
30
|
+
<div className="flex justify-center mb-4">
|
|
31
|
+
<img src={logoUrl} alt="Logo" className="h-10 object-contain" />
|
|
32
|
+
</div>
|
|
33
|
+
)}
|
|
34
|
+
|
|
35
|
+
<div className="font-bold mb-2" style={{ color: titleColor }}>
|
|
36
|
+
Forgot Password?
|
|
15
37
|
</div>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
>
|
|
38
|
+
|
|
39
|
+
<div className="text-sm text-center mb-4 mx-auto">
|
|
40
|
+
Please enter your account email to reset your password!
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<Form layout="vertical" onFinish={({ email }) => handleForgotPassword(email)}>
|
|
23
44
|
<Row gutter={[0, 10]}>
|
|
24
|
-
<
|
|
25
|
-
label={'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
>
|
|
29
|
-
<Input />
|
|
30
|
-
</Form.Item>
|
|
45
|
+
<Col span={24}>
|
|
46
|
+
<Form.Item label="Email" name="email" rules={[{ required: true, message: 'Please enter your email' }]}>
|
|
47
|
+
<Input />
|
|
48
|
+
</Form.Item>
|
|
49
|
+
</Col>
|
|
31
50
|
</Row>
|
|
51
|
+
|
|
52
|
+
<div className="flex justify-center mt-5">
|
|
53
|
+
<Button
|
|
54
|
+
htmlType="submit"
|
|
55
|
+
className="w-full"
|
|
56
|
+
style={{
|
|
57
|
+
color: '#fff',
|
|
58
|
+
backgroundColor: primaryColor,
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
Submit Request
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
32
64
|
</Form>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
39
|
-
</
|
|
40
|
-
</
|
|
41
|
-
|
|
42
|
-
</Row>
|
|
65
|
+
|
|
66
|
+
<div className="flex justify-center mt-4">
|
|
67
|
+
<Button type="link" onClick={() => navigate('/login')}>
|
|
68
|
+
Back to Login
|
|
69
|
+
</Button>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</Spin>
|
|
43
74
|
)
|
|
44
75
|
}
|
|
@@ -6,6 +6,7 @@ import { useNavigate } from 'react-router-dom'
|
|
|
6
6
|
|
|
7
7
|
export function UnauthenticatedLayout() {
|
|
8
8
|
const { config } = useConfigContext()
|
|
9
|
+
console.log(config?.siteLanguages)
|
|
9
10
|
const navigate = useNavigate()
|
|
10
11
|
const loginLayout = config?.loginLayout
|
|
11
12
|
const siteIdentity = config?.siteIdentity
|
|
@@ -77,7 +77,7 @@ export const layoutTemplates = [
|
|
|
77
77
|
<div key={form.id} className="">
|
|
78
78
|
<Link
|
|
79
79
|
to={href}
|
|
80
|
-
target={form.
|
|
80
|
+
target={form.newTab ? '_blank' : '_self'}
|
|
81
81
|
onClick={isParentMenu ? () => toggleMenu(form.id) : undefined}
|
|
82
82
|
style={{
|
|
83
83
|
width: `${navigationWidth - 25}px`,
|
|
@@ -127,15 +127,16 @@ export const layoutTemplates = [
|
|
|
127
127
|
const menu = (
|
|
128
128
|
<Menu className="text-primary">
|
|
129
129
|
{menuItems?.map(({ name, icon: Icon, onClick }) => (
|
|
130
|
-
<Menu.Item key={name}>
|
|
131
|
-
<
|
|
130
|
+
<Menu.Item key={name} onClick={onClick}>
|
|
131
|
+
<div className="flex items-center gap-2 px-3 py-1 text-md">
|
|
132
132
|
<Icon />
|
|
133
133
|
{name}
|
|
134
|
-
</
|
|
134
|
+
</div>
|
|
135
135
|
</Menu.Item>
|
|
136
136
|
))}
|
|
137
137
|
</Menu>
|
|
138
138
|
)
|
|
139
|
+
|
|
139
140
|
return (
|
|
140
141
|
<Layout className="h-screen overflow-y-auto fc-layout">
|
|
141
142
|
<Header className="sticky top-0 z-40 flex items-center shadow-sm justify-between px-1 overflow-hidden fc-header">
|
|
@@ -190,7 +191,7 @@ export const layoutTemplates = [
|
|
|
190
191
|
<Button type="link" className="">
|
|
191
192
|
<span className="ml-4 text-primary text-md font-semibold">
|
|
192
193
|
<div className="hidden">{userName}</div>
|
|
193
|
-
<span className="italic text-warning font-normal">
|
|
194
|
+
<span className="italic text-warning font-normal">Admin</span>
|
|
194
195
|
</span>
|
|
195
196
|
<FaCaretDown className="text-primary ml-1" />
|
|
196
197
|
</Button>
|
|
@@ -281,7 +282,7 @@ export const layoutTemplates = [
|
|
|
281
282
|
<div key={form.id} className="relative group">
|
|
282
283
|
<Link
|
|
283
284
|
to={href}
|
|
284
|
-
target={form.
|
|
285
|
+
target={form.newTab ? '_blank' : '_self'}
|
|
285
286
|
onClick={isParentMenu ? (e) => e.preventDefault() : undefined}
|
|
286
287
|
style={{
|
|
287
288
|
borderRadius: `${siteConfigs?.Link.borderRadius}px`,
|
|
@@ -330,15 +331,16 @@ export const layoutTemplates = [
|
|
|
330
331
|
const menu = (
|
|
331
332
|
<Menu className="text-primary">
|
|
332
333
|
{menuItems?.map(({ name, icon: Icon, onClick }) => (
|
|
333
|
-
<Menu.Item key={name}>
|
|
334
|
-
<
|
|
334
|
+
<Menu.Item key={name} onClick={onClick}>
|
|
335
|
+
<div className="flex items-center gap-2 px-3 py-1 text-md">
|
|
335
336
|
<Icon />
|
|
336
337
|
{name}
|
|
337
|
-
</
|
|
338
|
+
</div>
|
|
338
339
|
</Menu.Item>
|
|
339
340
|
))}
|
|
340
341
|
</Menu>
|
|
341
342
|
)
|
|
343
|
+
|
|
342
344
|
return (
|
|
343
345
|
<Layout className="fc-layout">
|
|
344
346
|
<Header className="fc-header sticky top-0 z-40 flex items-center shadow-sm justify-between px-1 overflow-hidden">
|
|
@@ -403,7 +405,7 @@ export const layoutTemplates = [
|
|
|
403
405
|
<Button type="link" className="">
|
|
404
406
|
<span className="ml-4 text-primary text-md font-semibold">
|
|
405
407
|
<div className="hidden">{userName}</div>
|
|
406
|
-
<span className="italic text-warning font-normal">
|
|
408
|
+
<span className="italic text-warning font-normal">Admin</span>
|
|
407
409
|
</span>
|
|
408
410
|
<FaCaretDown className="text-primary ml-1" />
|
|
409
411
|
</Button>
|
|
@@ -484,7 +486,7 @@ export const layoutTemplates = [
|
|
|
484
486
|
<div key={form.id} className="menu-item">
|
|
485
487
|
<Link
|
|
486
488
|
to={href}
|
|
487
|
-
target={form.
|
|
489
|
+
target={form.newTab ? '_blank' : '_self'}
|
|
488
490
|
onClick={isParentMenu ? () => toggleMenu(form.id) : undefined}
|
|
489
491
|
style={{
|
|
490
492
|
width: `${navigationWidth - 25}px`,
|
|
@@ -535,11 +537,11 @@ export const layoutTemplates = [
|
|
|
535
537
|
const menu = (
|
|
536
538
|
<Menu className="text-primary">
|
|
537
539
|
{menuItems?.map(({ name, icon: Icon, onClick }) => (
|
|
538
|
-
<Menu.Item key={name}>
|
|
539
|
-
<
|
|
540
|
+
<Menu.Item key={name} onClick={onClick}>
|
|
541
|
+
<div className="flex items-center gap-2 px-3 py-1 text-md">
|
|
540
542
|
<Icon />
|
|
541
543
|
{name}
|
|
542
|
-
</
|
|
544
|
+
</div>
|
|
543
545
|
</Menu.Item>
|
|
544
546
|
))}
|
|
545
547
|
</Menu>
|
|
@@ -588,7 +590,7 @@ export const layoutTemplates = [
|
|
|
588
590
|
) : (
|
|
589
591
|
<span className="text-primary font-semibold text-md">
|
|
590
592
|
<div className="hidden">{userName}</div>
|
|
591
|
-
<span className="italic text-warning font-normal">
|
|
593
|
+
<span className="italic text-warning font-normal">Admin</span>
|
|
592
594
|
</span>
|
|
593
595
|
)}
|
|
594
596
|
<FaCaretDown className="text-primary ml-1" />
|
|
@@ -654,7 +656,7 @@ export const layoutTemplates = [
|
|
|
654
656
|
) : (
|
|
655
657
|
<span className="text-primary font-semibold text-md">
|
|
656
658
|
<div className="hidden">{userName}</div>
|
|
657
|
-
<span className="italic text-warning font-normal">
|
|
659
|
+
<span className="italic text-warning font-normal">Admin</span>
|
|
658
660
|
</span>
|
|
659
661
|
)}
|
|
660
662
|
<FaCaretDown className="text-primary ml-1" />
|