Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/locales/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@
"email": "E-Mail-Adresse",
"password": "Passwort",
"confirmPassword": "Passwort bestätigen",
"phone": "Telefonnummer",
"organizationName": "Name der Organisation",
"organizationType": "Art der Organisation",
"selectOrganizationType": "Typ auswählen…",
Expand All @@ -1921,6 +1922,7 @@
"errors": {
"passwordTooShort": "Das Passwort muss mindestens 8 Zeichen lang sein",
"passwordMismatch": "Die Passwörter stimmen nicht überein",
"phoneTooShort": "Die Telefonnummer muss mindestens 7 Zeichen lang sein",
"emailDomainNotAllowed": "Ihre E-Mail-Domain ist nicht auf unserer genehmigten NGO-Liste. Bitte verwenden Sie die E-Mail-Adresse Ihrer Organisation.",
"missingToken": "Dein Registrierungslink ist ungültig oder abgelaufen. Bitte verwende den Link aus deiner Bestätigungs-E-Mail."
},
Expand Down
2 changes: 2 additions & 0 deletions public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@
"email": "Email address",
"password": "Password",
"confirmPassword": "Confirm password",
"phone": "Phone number",
"organizationName": "Organisation name",
"organizationType": "Organisation type",
"selectOrganizationType": "Select type…",
Expand All @@ -1553,6 +1554,7 @@
"errors": {
"passwordTooShort": "Password must be at least 8 characters",
"passwordMismatch": "Passwords do not match",
"phoneTooShort": "Phone number must be at least 7 characters",
"emailDomainNotAllowed": "Your email domain is not on our approved NGO list. Please use your organisation email address.",
"missingToken": "Your registration link is invalid or has expired. Please use the link from your verification email."
},
Expand Down
1 change: 1 addition & 0 deletions src/components/AgentRegistration/AgentRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function AgentRegistration() {
person: {
firstName: formData.firstName,
lastName: formData.lastName,
phone: formData.phone,
},
});

Expand Down
2 changes: 2 additions & 0 deletions src/components/AgentRegistration/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export function validateStep(
if (!data.confirmPassword) errors.confirmPassword = required;
else if (data.password !== data.confirmPassword)
errors.confirmPassword = t("agentRegistration.errors.passwordMismatch");
if (!data.phone.trim()) errors.phone = required;
else if (data.phone.trim().length < 7) errors.phone = t("agentRegistration.errors.phoneTooShort");
}

return errors;
Expand Down
11 changes: 11 additions & 0 deletions src/components/AgentRegistration/steps/AccountStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ export function AccountStep({ data, onChange, errors }: Props) {
errors={errors.confirmPassword ? [errors.confirmPassword] : []}
/>
</FieldWrapper>

<FieldWrapper>
<FieldLabel>{t("agentRegistration.fields.phone")}</FieldLabel>
<FormInput
type="tel"
value={data.phone}
onInputChange={(v) => onChange({ phone: v })}
placeHolder={t("agentRegistration.fields.phone")}
errors={errors.phone ? [errors.phone] : []}
/>
</FieldWrapper>
</div>
);
}
2 changes: 2 additions & 0 deletions src/components/AgentRegistration/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface AgentRegistrationData {
email: string;
password: string;
confirmPassword: string;
phone: string;
}

export const defaultAgentRegistrationData: AgentRegistrationData = {
Expand All @@ -14,6 +15,7 @@ export const defaultAgentRegistrationData: AgentRegistrationData = {
email: "",
password: "",
confirmPassword: "",
phone: "",
};

export const TOTAL_STEPS = 1;
Expand Down
Loading