diff --git a/public/locales/bg/validation.json b/public/locales/bg/validation.json index 8e1bc2d71..35793eb3c 100644 --- a/public/locales/bg/validation.json +++ b/public/locales/bg/validation.json @@ -22,5 +22,6 @@ "legal-entity": "Юридическо лице", "unique-field-violation": "Полето `{1}` със тази стойност вече съществува в платформата.", "payment-reference": "Невалиден формат на кода за плащане", - "eik-invalid": "Невалидно ЕИК" -} + "eik-invalid": "Невалидно ЕИК", + "help-us-improve": "Искате ли да ни помогнете да подобрим платформата? Искаме да чуем Вашето мнение? Отделете ни 30 минути, за подобрите платформа на Подкрепи.бг" +} \ No newline at end of file diff --git a/public/locales/en/validation.json b/public/locales/en/validation.json index bd0126637..01883718f 100644 --- a/public/locales/en/validation.json +++ b/public/locales/en/validation.json @@ -22,5 +22,6 @@ "newsletter": "Please give your consent", "unique-field-violation": "The field `{1}` with this value already exists in the platform.", "payment-reference": "Invalid payment code format", - "eik-invalid": "Invalid EIK" -} + "eik-invalid": "Invalid EIK", + "help-us-improve": "Do you want to help us improve the platform? We want to hear from you? Please spare 30 minutes to help us improve Podkrepi.bg" +} \ No newline at end of file diff --git a/src/components/client/auth/register/CorporateRegisterForm.tsx b/src/components/client/auth/register/CorporateRegisterForm.tsx index 35b1e2caa..c3e6bf699 100644 --- a/src/components/client/auth/register/CorporateRegisterForm.tsx +++ b/src/components/client/auth/register/CorporateRegisterForm.tsx @@ -14,6 +14,7 @@ import { AcceptNewsLetterField } from 'components/common/form/AcceptNewsletterFi import { AccountType } from 'gql/user-registration' import { validateEIK13, validateEIK9 } from 'components/common/validations/EIKValidator' import { CorporateRegisterFormData } from 'gql/user-registration' +import HelpUsImproveField from 'components/common/form/HelpUsImproveField' const validationSchema: yup.SchemaOf = yup .object() @@ -39,6 +40,7 @@ const validationSchema: yup.SchemaOf = yup terms: yup.bool().required().oneOf([true], 'validation:terms-of-use'), gdpr: yup.bool().required().oneOf([true], 'validation:terms-of-service'), newsletter: yup.bool().required().oneOf([true, false]), + helpUsImprove: yup.bool().required().oneOf([true, false]), }) export type RegisterFormProps = { @@ -59,6 +61,7 @@ export default function CorporateRegisterForm({ onSubmit, loading }: RegisterFor terms: false, gdpr: false, newsletter: false, + helpUsImprove: false, } return ( + diff --git a/src/components/client/auth/register/RegisterForm.tsx b/src/components/client/auth/register/RegisterForm.tsx index 5ee114f58..9aaa66672 100644 --- a/src/components/client/auth/register/RegisterForm.tsx +++ b/src/components/client/auth/register/RegisterForm.tsx @@ -13,6 +13,7 @@ import { AcceptNewsLetterField } from 'components/common/form/AcceptNewsletterFi import { AccountType } from 'gql/user-registration' import { IndividualRegisterFormData } from 'gql/user-registration' +import HelpUsImproveField from 'components/common/form/HelpUsImproveField' const validationSchema: yup.SchemaOf = yup .object() @@ -27,6 +28,7 @@ const validationSchema: yup.SchemaOf = yup terms: yup.bool().required().oneOf([true], 'validation:terms-of-use'), gdpr: yup.bool().required().oneOf([true], 'validation:terms-of-service'), newsletter: yup.bool().required().oneOf([true, false]), + helpUsImprove: yup.bool().required().oneOf([true, false]), }) export type RegisterFormProps = { @@ -45,6 +47,7 @@ export default function RegisterForm({ onSubmit, loading }: RegisterFormProps) { terms: false, gdpr: false, newsletter: false, + helpUsImprove: false, } return ( + diff --git a/src/components/common/form/HelpUsImproveField.tsx b/src/components/common/form/HelpUsImproveField.tsx new file mode 100644 index 000000000..9852f50e3 --- /dev/null +++ b/src/components/common/form/HelpUsImproveField.tsx @@ -0,0 +1,18 @@ +import { useTranslation } from 'next-i18next' +import { Typography } from '@mui/material' + +import CheckboxField from 'components/common/form/CheckboxField' + +export type HelpUsImproveFieldProps = { + name: string +} + +export default function HelpUsImproveField({ name }: HelpUsImproveFieldProps) { + const { t } = useTranslation() + return ( + {t('validation:help-us-improve')} } + /> + ) +} diff --git a/src/gql/user-registration.ts b/src/gql/user-registration.ts index 5b93ce358..1843937ce 100644 --- a/src/gql/user-registration.ts +++ b/src/gql/user-registration.ts @@ -13,6 +13,7 @@ export type IndividualRegisterFormData = { terms: boolean gdpr: boolean newsletter?: boolean + helpUsImprove?: boolean } export type CorporateRegisterFormData = IndividualRegisterFormData & {