ublo-lib 1.12.9 → 1.12.10
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.
|
@@ -54,7 +54,8 @@ const CustomContactForm = ({
|
|
|
54
54
|
data,
|
|
55
55
|
fields,
|
|
56
56
|
subjectPrefix: subject?.prefix,
|
|
57
|
-
subjectSuffix: subject?.suffix
|
|
57
|
+
subjectSuffix: subject?.suffix,
|
|
58
|
+
kind
|
|
58
59
|
});
|
|
59
60
|
if (error) {
|
|
60
61
|
snackbar.show({
|
|
@@ -131,7 +132,7 @@ const CustomContactForm = ({
|
|
|
131
132
|
settings: settings,
|
|
132
133
|
presets: presets?.values
|
|
133
134
|
}, key))
|
|
134
|
-
}
|
|
135
|
+
}), _jsxs("div", {
|
|
135
136
|
className: styles.bottom,
|
|
136
137
|
children: [presets?.allowReset && _jsx(Button, {
|
|
137
138
|
className: styles.resetButton,
|
|
@@ -154,6 +155,6 @@ const CustomContactForm = ({
|
|
|
154
155
|
children: Messages.get(lang, "sending")
|
|
155
156
|
})]
|
|
156
157
|
})]
|
|
157
|
-
});
|
|
158
|
+
}, formKey);
|
|
158
159
|
};
|
|
159
160
|
export default React.memo(CustomContactFormWithSnackbar);
|
|
@@ -25,14 +25,7 @@ export const getInitialFormState = (fields, presets) => Object.keys(fields).redu
|
|
|
25
25
|
} = field;
|
|
26
26
|
if (type === "title") return acc;
|
|
27
27
|
if (key === "subject") {
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
...acc,
|
|
31
|
-
[key]: {
|
|
32
|
-
value,
|
|
33
|
-
valid: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
28
|
+
return acc;
|
|
36
29
|
}
|
|
37
30
|
if (type === "checkbox") {
|
|
38
31
|
const value = presets?.[key] ?? false;
|
|
@@ -92,7 +85,8 @@ export const send = async ({
|
|
|
92
85
|
data,
|
|
93
86
|
fields,
|
|
94
87
|
subjectPrefix,
|
|
95
|
-
subjectSuffix
|
|
88
|
+
subjectSuffix,
|
|
89
|
+
kind
|
|
96
90
|
}) => {
|
|
97
91
|
const endpoint = `https://contacts.valraiso.net/api/contact/${site}`;
|
|
98
92
|
const dataKeys = Object.keys(data);
|
|
@@ -116,6 +110,9 @@ export const send = async ({
|
|
|
116
110
|
if (subjectSuffix) {
|
|
117
111
|
formData.append("subjectSuffix", subjectSuffix);
|
|
118
112
|
}
|
|
113
|
+
if (kind) {
|
|
114
|
+
formData.append("kind", kind);
|
|
115
|
+
}
|
|
119
116
|
const response = await fetch(endpoint, {
|
|
120
117
|
method: "POST",
|
|
121
118
|
body: formData
|