@sikka/hawa 0.0.155 → 0.0.156
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/es/blocks/AuthForms/SignUpForm.d.ts +1 -1
- package/es/index.es.js +1 -1
- package/lib/blocks/AuthForms/SignUpForm.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/SignUpForm.tsx +76 -63
- package/storybook-static/870.6284ce82.iframe.bundle.js +2 -0
- package/storybook-static/{870.c002064e.iframe.bundle.js.LICENSE.txt → 870.6284ce82.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.e0e4e1a0.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/870.c002064e.iframe.bundle.js +0 -2
- package/storybook-static/main.f926f5e7.iframe.bundle.js +0 -1
package/package.json
CHANGED
|
@@ -42,7 +42,6 @@ type SignUpFormTypes = {
|
|
|
42
42
|
twitterButtonLabel: string
|
|
43
43
|
}
|
|
44
44
|
showUserSource: any
|
|
45
|
-
signUpType: any
|
|
46
45
|
viaGoogle: boolean
|
|
47
46
|
viaGithub: boolean
|
|
48
47
|
viaTwitter: boolean
|
|
@@ -58,6 +57,7 @@ type SignUpFormTypes = {
|
|
|
58
57
|
showError: any
|
|
59
58
|
errorTitle: any
|
|
60
59
|
errorText: any
|
|
60
|
+
signUpFields: any[]
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
@@ -80,68 +80,81 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
80
80
|
)}
|
|
81
81
|
<FormProvider {...methods}>
|
|
82
82
|
<form onSubmit={handleSubmit((e) => props.handleSignUp(e))}>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
83
|
+
<div>
|
|
84
|
+
{props.signUpFields.map((fld) => {
|
|
85
|
+
if (fld === "fullname") {
|
|
86
|
+
return (
|
|
87
|
+
<Controller
|
|
88
|
+
control={control}
|
|
89
|
+
name="fullName"
|
|
90
|
+
render={({ field }) => (
|
|
91
|
+
<HawaTextField
|
|
92
|
+
width="full"
|
|
93
|
+
type="text"
|
|
94
|
+
label={props.texts.fullNameLabel}
|
|
95
|
+
placeholder={props.texts.fullNamePlaceholder}
|
|
96
|
+
helperText={errors.fullName?.message}
|
|
97
|
+
onChange={field.onChange}
|
|
98
|
+
value={field.value ?? ""}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
rules={{
|
|
102
|
+
required: props.texts.fullNameRequiredText,
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
if (fld === "email") {
|
|
108
|
+
return (
|
|
109
|
+
<Controller
|
|
110
|
+
control={control}
|
|
111
|
+
name="email"
|
|
112
|
+
render={({ field }) => (
|
|
113
|
+
<HawaTextField
|
|
114
|
+
width="full"
|
|
115
|
+
type="text"
|
|
116
|
+
label={props.texts.emailLabel}
|
|
117
|
+
helperText={errors.email?.message}
|
|
118
|
+
placeholder={props.texts.emailPlaceholder}
|
|
119
|
+
onChange={field.onChange}
|
|
120
|
+
value={field.value ?? ""}
|
|
121
|
+
/>
|
|
122
|
+
)}
|
|
123
|
+
rules={{
|
|
124
|
+
required: props.texts.emailRequiredText,
|
|
125
|
+
pattern: {
|
|
126
|
+
value:
|
|
127
|
+
/^(([^<>()[\]\\.,;:\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,}))$/,
|
|
128
|
+
message: props.texts.emailInvalidText,
|
|
129
|
+
},
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
if (fld === "username") {
|
|
135
|
+
return (
|
|
136
|
+
<Controller
|
|
137
|
+
control={control}
|
|
138
|
+
name="username"
|
|
139
|
+
render={({ field }) => (
|
|
140
|
+
<HawaTextField
|
|
141
|
+
width="full"
|
|
142
|
+
type="text"
|
|
143
|
+
label={props.texts.usernameLabel}
|
|
144
|
+
helperText={errors.username?.message}
|
|
145
|
+
placeholder={props.texts.usernamePlaceholder}
|
|
146
|
+
onChange={field.onChange}
|
|
147
|
+
value={field.value ?? ""}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
rules={{
|
|
151
|
+
required: props.texts.usernameRequired,
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
})}
|
|
157
|
+
</div>
|
|
145
158
|
<Controller
|
|
146
159
|
control={control}
|
|
147
160
|
name="password"
|