@sikka/hawa 0.1.1 → 0.1.3
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/dist/styles.css +24 -3
- package/es/blocks/AuthForms/AppLanding.d.ts +1 -0
- package/es/blocks/Misc/index.d.ts +0 -1
- package/es/index.es.js +3 -3
- package/lib/blocks/AuthForms/AppLanding.d.ts +1 -0
- package/lib/blocks/Misc/index.d.ts +0 -1
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/blocks/Account/UserProfileForm.tsx +94 -90
- package/src/blocks/Account/UserSettingsForm.tsx +7 -14
- package/src/blocks/AuthForms/AppLanding.tsx +71 -17
- package/src/blocks/AuthForms/CodeConfirmation.tsx +44 -43
- package/src/blocks/AuthForms/NewPasswordForm.tsx +66 -51
- package/src/blocks/AuthForms/ResetPasswordForm.tsx +53 -45
- package/src/blocks/AuthForms/SignInForm.tsx +0 -2
- package/src/blocks/AuthForms/SignInPhone.tsx +30 -29
- package/src/blocks/AuthForms/SignUpForm.tsx +0 -1
- package/src/blocks/Misc/EmptyState.tsx +27 -23
- package/src/blocks/Misc/LeadGenerator.tsx +27 -24
- package/src/blocks/Misc/NoPermission.tsx +25 -22
- package/src/blocks/Misc/NotFound.tsx +15 -15
- package/src/blocks/Misc/index.ts +0 -1
- package/src/blocks/Payment/ChargeWalletForm.tsx +25 -24
- package/src/blocks/Payment/CheckoutForm.tsx +194 -189
- package/src/blocks/Payment/Confirmation.tsx +36 -34
- package/src/blocks/Payment/CreditCardForm.tsx +71 -73
- package/src/blocks/Payment/PayWithWallet.tsx +13 -15
- package/src/blocks/Payment/SelectPayment.tsx +58 -54
- package/src/blocks/Referral/ReferralAccount.tsx +52 -49
- package/src/blocks/Referral/ReferralSettlement.tsx +64 -62
- package/src/blocks/Referral/ReferralStats.tsx +53 -51
- package/src/elements/HawaRadio.tsx +1 -1
- package/src/styles.css +24 -3
- package/es/blocks/Misc/Newsletter.d.ts +0 -12
- package/lib/blocks/Misc/Newsletter.d.ts +0 -12
- package/src/blocks/Misc/Newsletter.tsx +0 -50
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { FC } from "react"
|
|
2
|
-
import { HawaButton, HawaPhoneInput, HawaTextField } from "../../elements"
|
|
3
2
|
import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
4
|
-
import {
|
|
3
|
+
import { HawaPhoneInput, HawaTextField } from "../../elements"
|
|
4
|
+
import { Card, CardContent, CardFooter } from "../../elements/Card"
|
|
5
|
+
import { Button } from "../../elements/Button"
|
|
5
6
|
|
|
6
7
|
type UserProfileFormTypes = {
|
|
7
8
|
inputs: any
|
|
@@ -19,95 +20,98 @@ export const UserProfileForm: FC<UserProfileFormTypes> = (props) => {
|
|
|
19
20
|
} = methods
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
23
|
+
<Card>
|
|
24
|
+
<form onSubmit={handleSubmit((e) => props.handleUpdateProfile(e))}>
|
|
25
|
+
<CardContent headless>
|
|
26
|
+
<FormProvider {...methods}>
|
|
27
|
+
<Controller
|
|
28
|
+
control={control}
|
|
29
|
+
name="fullName"
|
|
30
|
+
render={({ field }) => (
|
|
31
|
+
<HawaTextField
|
|
32
|
+
width="full"
|
|
33
|
+
type="text"
|
|
34
|
+
label={props.texts.fullNameLabel}
|
|
35
|
+
placeholder={props.texts.fullNamePlaceholder}
|
|
36
|
+
helpertext={errors.fullName?.message}
|
|
37
|
+
{...field}
|
|
38
|
+
value={field.value ?? ""}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
<Controller
|
|
43
|
+
control={control}
|
|
44
|
+
name="phoneNumber"
|
|
45
|
+
render={({ field }) => <HawaPhoneInput label="Phone number" />}
|
|
46
|
+
/>
|
|
47
|
+
<Controller
|
|
48
|
+
control={control}
|
|
49
|
+
name="email"
|
|
50
|
+
render={({ field }) => (
|
|
51
|
+
<HawaTextField
|
|
52
|
+
width="full"
|
|
53
|
+
type="text"
|
|
54
|
+
label={props.texts.emailLabel}
|
|
55
|
+
helpertext={errors.email?.message}
|
|
56
|
+
placeholder={props.texts.emailPlaceholder}
|
|
57
|
+
{...field}
|
|
58
|
+
value={field.value ?? ""}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
rules={{
|
|
62
|
+
required: props.texts.emailRequiredText,
|
|
63
|
+
pattern: {
|
|
64
|
+
value:
|
|
65
|
+
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
66
|
+
message: props.texts.emailInvalidText,
|
|
67
|
+
},
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
<Controller
|
|
71
|
+
control={control}
|
|
72
|
+
name="password"
|
|
73
|
+
render={({ field }) => (
|
|
74
|
+
<HawaTextField
|
|
75
|
+
width="full"
|
|
76
|
+
type="password"
|
|
77
|
+
label={props.texts.passwordLabel}
|
|
78
|
+
placeholder={props.texts.passwordPlaceholder}
|
|
79
|
+
helpertext={errors.password?.message}
|
|
80
|
+
{...field}
|
|
81
|
+
value={field.value ?? ""}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
rules={{
|
|
85
|
+
required: props.texts.passwordRequiredText,
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
<Controller
|
|
90
|
+
control={control}
|
|
91
|
+
name="confirmPassword"
|
|
92
|
+
render={({ field }) => (
|
|
93
|
+
<HawaTextField
|
|
94
|
+
width="full"
|
|
95
|
+
type="password"
|
|
96
|
+
label={props.texts.confirmPasswordLabel}
|
|
97
|
+
placeholder={props.texts.confirmPasswordPlaceholder}
|
|
98
|
+
helpertext={errors.confirmPassword?.message}
|
|
99
|
+
{...field}
|
|
100
|
+
value={field.value ?? ""}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
rules={{
|
|
104
|
+
required: props.texts.confirmPasswordRequiredText,
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
</FormProvider>
|
|
108
|
+
</CardContent>
|
|
109
|
+
<CardFooter>
|
|
110
|
+
<Button className="w-full" type="submit">
|
|
107
111
|
{props.texts.updateProfile}
|
|
108
|
-
</
|
|
109
|
-
</
|
|
110
|
-
</
|
|
111
|
-
</
|
|
112
|
+
</Button>
|
|
113
|
+
</CardFooter>
|
|
114
|
+
</form>
|
|
115
|
+
</Card>
|
|
112
116
|
)
|
|
113
117
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FC } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { Card, CardContent } from "../../elements/Card"
|
|
3
3
|
|
|
4
4
|
type UserSettingsFormTypes = {
|
|
5
5
|
children: any
|
|
@@ -10,18 +10,11 @@ type UserSettingsFormTypes = {
|
|
|
10
10
|
|
|
11
11
|
export const UserSettingsForm: FC<UserSettingsFormTypes> = (props) => {
|
|
12
12
|
return (
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
width="full"
|
|
20
|
-
margins="none"
|
|
21
|
-
onClick={props.handleSaveSettings}
|
|
22
|
-
>
|
|
23
|
-
{props.saveSettingsText}
|
|
24
|
-
</HawaButton> */}
|
|
25
|
-
</HawaContainer>
|
|
13
|
+
<Card>
|
|
14
|
+
<CardContent headless>
|
|
15
|
+
<div className="mb-2 text-sm font-bold">{props.blockTitle}</div>
|
|
16
|
+
<div className="flex flex-col gap-4 rounded p-2">{props.children}</div>
|
|
17
|
+
</CardContent>
|
|
18
|
+
</Card>
|
|
26
19
|
)
|
|
27
20
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { FC } from "react"
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { HawaRadio } from "../../elements"
|
|
3
|
+
import { Card, CardContent } from "../../elements/Card"
|
|
4
|
+
import { Button } from "../../elements/Button"
|
|
4
5
|
|
|
5
6
|
type AppLandingTypes = {
|
|
6
7
|
handleSignIn: () => void
|
|
7
8
|
handleSignUp: () => void
|
|
8
9
|
handleLanguage: () => void
|
|
10
|
+
handleColorMode: () => void
|
|
9
11
|
texts: {
|
|
10
12
|
signIn: string
|
|
11
13
|
signUp: string
|
|
@@ -15,20 +17,72 @@ type AppLandingTypes = {
|
|
|
15
17
|
}
|
|
16
18
|
export const AppLanding: FC<AppLandingTypes> = (props) => {
|
|
17
19
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
{props.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
<div>
|
|
21
|
+
<Card>
|
|
22
|
+
<CardContent headless className="flex flex-col gap-6">
|
|
23
|
+
{props.handleSignIn && (
|
|
24
|
+
<Button onClick={props.handleSignIn}>{props.texts.signIn}</Button>
|
|
25
|
+
)}
|
|
26
|
+
{props.handleSignUp && (
|
|
27
|
+
<Button onClick={props.handleSignUp}>{props.texts.signUp}</Button>
|
|
28
|
+
)}
|
|
29
|
+
</CardContent>
|
|
30
|
+
</Card>
|
|
31
|
+
<div className="mt-6 flex flex-row justify-between">
|
|
32
|
+
<HawaRadio
|
|
33
|
+
onChangeTab={props.handleLanguage}
|
|
34
|
+
design="tabs"
|
|
35
|
+
options={[
|
|
36
|
+
{ value: "ar", label: "عربي" },
|
|
37
|
+
{ value: "en", label: "English" },
|
|
38
|
+
]}
|
|
39
|
+
/>
|
|
40
|
+
<HawaRadio
|
|
41
|
+
onChangeTab={props.handleColorMode}
|
|
42
|
+
design="tabs"
|
|
43
|
+
options={[
|
|
44
|
+
{
|
|
45
|
+
value: "light",
|
|
46
|
+
label: (
|
|
47
|
+
<svg
|
|
48
|
+
width="15"
|
|
49
|
+
height="15"
|
|
50
|
+
viewBox="0 0 15 15"
|
|
51
|
+
fill="none"
|
|
52
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
53
|
+
className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90"
|
|
54
|
+
>
|
|
55
|
+
<path
|
|
56
|
+
d="M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z"
|
|
57
|
+
fill="currentColor"
|
|
58
|
+
fill-rule="evenodd"
|
|
59
|
+
clip-rule="evenodd"
|
|
60
|
+
></path>
|
|
61
|
+
</svg>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: "dark",
|
|
66
|
+
label: (
|
|
67
|
+
<svg
|
|
68
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
69
|
+
width="24"
|
|
70
|
+
height="24"
|
|
71
|
+
viewBox="0 0 24 24"
|
|
72
|
+
fill="none"
|
|
73
|
+
stroke="currentColor"
|
|
74
|
+
stroke-width="2"
|
|
75
|
+
stroke-linecap="round"
|
|
76
|
+
stroke-linejoin="round"
|
|
77
|
+
className="h-[1.2rem] w-[1.2rem] transition-all dark:rotate-0 dark:scale-100"
|
|
78
|
+
>
|
|
79
|
+
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path>
|
|
80
|
+
</svg>
|
|
81
|
+
),
|
|
82
|
+
},
|
|
83
|
+
]}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
33
87
|
)
|
|
34
88
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, FC } from "react"
|
|
2
|
-
import { HawaAlert,
|
|
3
|
-
import {
|
|
2
|
+
import { HawaAlert, HawaPinInput } from "../../elements"
|
|
3
|
+
import { Card, CardContent } from "../../elements/Card"
|
|
4
|
+
import { Button } from "../../elements/Button"
|
|
4
5
|
|
|
5
6
|
type TConfirmation = {
|
|
6
7
|
showError?: any
|
|
@@ -25,47 +26,47 @@ type TConfirmation = {
|
|
|
25
26
|
export const CodeConfirmation: FC<TConfirmation> = (props) => {
|
|
26
27
|
const [pins, setPins] = useState(null)
|
|
27
28
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<div className="
|
|
38
|
-
|
|
29
|
+
<Card>
|
|
30
|
+
<CardContent headless>
|
|
31
|
+
{props.showError && (
|
|
32
|
+
<HawaAlert
|
|
33
|
+
title={props.errorTitle}
|
|
34
|
+
text={props.errorText}
|
|
35
|
+
severity="error"
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
38
|
+
<div className="mb-4 dark:text-white">
|
|
39
|
+
<div className="text-lg font-bold">
|
|
40
|
+
{props.texts.checkYourPhone ?? "Please check your phone"}
|
|
41
|
+
</div>
|
|
42
|
+
<div className="text-muted-foreground">
|
|
43
|
+
<span>{props.texts.weSentCode ?? "We've sent a code to "}</span>
|
|
44
|
+
<span>{props.phoneNumber}</span>
|
|
45
|
+
</div>{" "}
|
|
39
46
|
</div>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<HawaButton margins={"none"} color="primary" width="full">
|
|
65
|
-
{props.texts.confirm ?? "Confirm"}
|
|
66
|
-
</HawaButton>
|
|
67
|
-
</div>
|
|
68
|
-
</form>
|
|
69
|
-
</HawaContainer>
|
|
47
|
+
<form
|
|
48
|
+
onSubmit={(e) => {
|
|
49
|
+
e.preventDefault()
|
|
50
|
+
if (pins) {
|
|
51
|
+
props.submitConfirmation(pins)
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<HawaPinInput width="full" digits={6} getPins={(e) => setPins(e)} />
|
|
56
|
+
<div className=" py-2 text-center text-xs text-muted-foreground">
|
|
57
|
+
<span>{props.texts.didntGetCode ?? "Didn't get the code?"}</span>{" "}
|
|
58
|
+
<span className="cursor-pointer text-buttonPrimary-500">
|
|
59
|
+
{props.texts.resendCode ?? "Click to resend"}
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
<div className="mt-4 grid grid-cols-2 gap-2">
|
|
63
|
+
<Button variant="secondary">
|
|
64
|
+
{props.texts.cancel ?? "Cancel"}
|
|
65
|
+
</Button>
|
|
66
|
+
<Button>{props.texts.confirm ?? "Confirm"}</Button>
|
|
67
|
+
</div>
|
|
68
|
+
</form>
|
|
69
|
+
</CardContent>
|
|
70
|
+
</Card>
|
|
70
71
|
)
|
|
71
72
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React, { useState, FC } from "react"
|
|
2
|
-
import { HawaTextField, HawaAlert
|
|
2
|
+
import { HawaTextField, HawaAlert } from "../../elements"
|
|
3
3
|
import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardFooter,
|
|
9
|
+
CardHeader,
|
|
10
|
+
CardTitle,
|
|
11
|
+
} from "../../elements/Card"
|
|
12
|
+
import { Button } from "../../elements/Button"
|
|
5
13
|
|
|
6
14
|
type NewPasswordTypes = {
|
|
7
15
|
handleNewPassword: () => void
|
|
@@ -37,65 +45,72 @@ export const NewPasswordForm: FC<NewPasswordTypes> = (props) => {
|
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
return (
|
|
40
|
-
<
|
|
41
|
-
{" "}
|
|
48
|
+
<Card>
|
|
42
49
|
{matchError && (
|
|
43
50
|
<HawaAlert text={props.texts.passwordMatchError} severity="error" />
|
|
44
51
|
)}
|
|
45
52
|
{props.passwordChanged ? (
|
|
46
|
-
<
|
|
53
|
+
<CardContent headless>
|
|
54
|
+
<div className="text-center">{props.texts.passwordChanged}</div>
|
|
55
|
+
</CardContent>
|
|
47
56
|
) : (
|
|
48
57
|
<FormProvider {...methods}>
|
|
49
58
|
<form onSubmit={handleSubmit(handleSubmission)}>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
59
|
+
<CardHeader>
|
|
60
|
+
<CardTitle>Create Password</CardTitle>
|
|
61
|
+
<CardDescription>
|
|
62
|
+
Set a new password for your account
|
|
63
|
+
</CardDescription>
|
|
64
|
+
</CardHeader>
|
|
65
|
+
<CardContent>
|
|
66
|
+
<Controller
|
|
67
|
+
control={control}
|
|
68
|
+
name="password"
|
|
69
|
+
render={({ field }) => (
|
|
70
|
+
<HawaTextField
|
|
71
|
+
width="full"
|
|
72
|
+
type="password"
|
|
73
|
+
autoComplete="new-password"
|
|
74
|
+
label={props.texts.passwordLabel}
|
|
75
|
+
placeholder={props.texts.passwordPlaceholder}
|
|
76
|
+
helpertext={errors.password?.message}
|
|
77
|
+
{...field}
|
|
78
|
+
value={field.value ?? ""}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
rules={{
|
|
82
|
+
required: props.texts.passwordRequiredText,
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
<Controller
|
|
86
|
+
control={control}
|
|
87
|
+
name="confirmPassword"
|
|
88
|
+
render={({ field }) => (
|
|
89
|
+
<HawaTextField
|
|
90
|
+
width="full"
|
|
91
|
+
type="password"
|
|
92
|
+
autoComplete="new-password"
|
|
93
|
+
label={props.texts.confirmPasswordLabel}
|
|
94
|
+
placeholder={props.texts.confirmPasswordPlaceholder}
|
|
95
|
+
helpertext={errors.confirmPassword?.message}
|
|
96
|
+
{...field}
|
|
97
|
+
value={field.value ?? ""}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
100
|
+
rules={{
|
|
101
|
+
required: props.texts.confirmPasswordRequiredText,
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
</CardContent>
|
|
88
105
|
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
>
|
|
94
|
-
{props.texts.updatePassword}
|
|
95
|
-
</HawaButton>
|
|
106
|
+
<CardFooter>
|
|
107
|
+
<Button className="w-full" type="submit">
|
|
108
|
+
{props.texts.updatePassword}
|
|
109
|
+
</Button>
|
|
110
|
+
</CardFooter>
|
|
96
111
|
</form>
|
|
97
112
|
</FormProvider>
|
|
98
113
|
)}
|
|
99
|
-
</
|
|
114
|
+
</Card>
|
|
100
115
|
)
|
|
101
116
|
}
|