diff --git a/src/components/Shared/NewsletterFormComponent/index.tsx b/src/components/Shared/NewsletterFormComponent/index.tsx index 8a62e3e..1091f51 100644 --- a/src/components/Shared/NewsletterFormComponent/index.tsx +++ b/src/components/Shared/NewsletterFormComponent/index.tsx @@ -11,6 +11,7 @@ export default function NewsletterFormComponent({ newsletterData }: any) { const [languageOptions, setLanguageOptions] = useState([]); const [interestsOptions, setInterestsOptions] = useState([]); const [blockchainOptions, setBlockchainOptions] = useState([]); + const [legalConsentOptions, setLegalConsentOptions] = useState(null); const [submitError, setSubmitError] = useState(""); const [submitSuccess, setSubmitSuccess] = useState(""); @@ -26,6 +27,7 @@ export default function NewsletterFormComponent({ newsletterData }: any) { setLanguageOptions(json.languageOptions); setInterestsOptions(json.interestsOptions); setBlockchainOptions(json.blockchainOptions); + setLegalConsentOptions(json.legalConsentOptions); }; getData(); @@ -172,7 +174,17 @@ export default function NewsletterFormComponent({ newsletterData }: any) { country_dropdown: selectValues["country_label"], preferred_programming_language: selectValues["preferred_language_label"] ?? "", interests__developer_portal_: selectValues["interests_label"] ?? "", - blockchain_familiarity: selectValues["blockchain_familiarity_label"] ?? "" + blockchain_familiarity: selectValues["blockchain_familiarity_label"] ?? "", + legal_consent: { + value: agree, + subscriptionTypeId: legalConsentOptions.communicationsCheckboxes[0].subscriptionTypeId, + text: legalConsentOptions.communicationsCheckboxes[0].label + }, + page_context: { + hutk: null, + pageUri: location.href, + pageName: document.title + } }) }); @@ -318,8 +330,14 @@ export default function NewsletterFormComponent({ newsletterData }: any) { > {icons.check} - - {newsletterData.agree_label} + {legalConsentOptions && ( + + )} {agreeError && (