@pollar/react 0.11.4-rc.1 → 0.11.4-rc.2
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/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1038,7 +1038,7 @@ var PollarModalFooter = ({ shield = false }) => {
|
|
|
1038
1038
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pollar-footer-name", children: "Pollar" }),
|
|
1039
1039
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-footer-version", children: [
|
|
1040
1040
|
"v",
|
|
1041
|
-
"0.11.4-rc.
|
|
1041
|
+
"0.11.4-rc.2"
|
|
1042
1042
|
] })
|
|
1043
1043
|
] })
|
|
1044
1044
|
] });
|
|
@@ -3915,6 +3915,7 @@ var REGISTRY_COPY = {
|
|
|
3915
3915
|
notApplicable: "This check is only for Bolivian ID cards (CI). Your verified document is not one, so this route is not available.",
|
|
3916
3916
|
identityRequired: "Verify your identity first.",
|
|
3917
3917
|
nameMismatch: "Both surnames together must read as on your document: {full}.",
|
|
3918
|
+
rejected: "The registry did not confirm: {fields}. Check how they are written and try again.",
|
|
3918
3919
|
loadError: "Could not load your details. Please try again.",
|
|
3919
3920
|
submitError: "Could not check your details. Please try again.",
|
|
3920
3921
|
step: "Step {n} of {total}"
|
|
@@ -3936,6 +3937,7 @@ var REGISTRY_COPY = {
|
|
|
3936
3937
|
notApplicable: "Esta validaci\xF3n es solo para c\xE9dulas bolivianas (CI). Tu documento verificado no lo es, as\xED que esta ruta no est\xE1 disponible.",
|
|
3937
3938
|
identityRequired: "Primero verifica tu identidad.",
|
|
3938
3939
|
nameMismatch: "Los dos apellidos juntos deben leerse como en tu documento: {full}.",
|
|
3940
|
+
rejected: "El registro no confirm\xF3: {fields}. Revisa c\xF3mo est\xE1n escritos e intenta de nuevo.",
|
|
3939
3941
|
loadError: "No se pudieron cargar tus datos. Intenta de nuevo.",
|
|
3940
3942
|
submitError: "No se pudieron validar tus datos. Intenta de nuevo.",
|
|
3941
3943
|
step: "Paso {n} de {total}"
|
|
@@ -4029,6 +4031,7 @@ function RegistryCheckModal({ optionId, progress, onClose, onApproved }) {
|
|
|
4029
4031
|
if (loaded.status === "approved") return onApproved();
|
|
4030
4032
|
setCheck(loaded);
|
|
4031
4033
|
if (loaded.status === "pending") setReview(true);
|
|
4034
|
+
if (loaded.status === "rejected") setError(rejectedMessage(loaded.rejectedFields));
|
|
4032
4035
|
if (loaded.prefill.applies) {
|
|
4033
4036
|
setSurname1(loaded.prefill.surname1);
|
|
4034
4037
|
setSurname2(loaded.prefill.surname2 ?? "");
|
|
@@ -4040,6 +4043,11 @@ function RegistryCheckModal({ optionId, progress, onClose, onApproved }) {
|
|
|
4040
4043
|
});
|
|
4041
4044
|
}, [optionId]);
|
|
4042
4045
|
const prefill = check?.prefill.applies ? check.prefill : null;
|
|
4046
|
+
function rejectedMessage(fields) {
|
|
4047
|
+
const labels = { surname1: copy.surname1, surname2: copy.surname2, complementNumber: copy.complement };
|
|
4048
|
+
const named = (fields ?? []).map((field) => labels[field] ?? field);
|
|
4049
|
+
return copy.rejected.replace("{fields}", named.length ? named.join(", ") : copy.surname2);
|
|
4050
|
+
}
|
|
4043
4051
|
async function submit() {
|
|
4044
4052
|
if (!prefill) return;
|
|
4045
4053
|
setSubmitting(true);
|
|
@@ -4052,6 +4060,7 @@ function RegistryCheckModal({ optionId, progress, onClose, onApproved }) {
|
|
|
4052
4060
|
});
|
|
4053
4061
|
if (!mounted.current) return;
|
|
4054
4062
|
if (result.status === "approved") onApproved();
|
|
4063
|
+
else if (result.status === "rejected") setError(rejectedMessage(result.rejectedFields));
|
|
4055
4064
|
else setReview(true);
|
|
4056
4065
|
} catch (e) {
|
|
4057
4066
|
if (!mounted.current) return;
|