diff --git a/src/components/CookieConsent/README.md b/src/components/CookieConsent/README.md index d1effb08..77c18ecd 100644 --- a/src/components/CookieConsent/README.md +++ b/src/components/CookieConsent/README.md @@ -53,6 +53,7 @@ const Analytics = () => { consentManager={consentManager} cookieList={cookieList} onConsentPopupClose={props.onClose} + modalClassName={'unique-class-name-for-adblockers'} /> ); }; diff --git a/src/components/CookieConsent/__stories__/CookieConsent.stories.tsx b/src/components/CookieConsent/__stories__/CookieConsent.stories.tsx index 6ce321c7..dd76af44 100644 --- a/src/components/CookieConsent/__stories__/CookieConsent.stories.tsx +++ b/src/components/CookieConsent/__stories__/CookieConsent.stories.tsx @@ -72,6 +72,7 @@ ConsentPopup.args = { consentMode: ConsentMode.Manage, policyLink: 'https://google.com', cookieList, + modalClassName: 'unique-class-name-for-adblockers', } as DefaultTemplateProps; export const ManageCookies = DefaultTemplate.bind({}); @@ -80,6 +81,7 @@ ManageCookies.args = { manageCookies: true, policyLink: 'https://google.com', cookieList, + modalClassName: 'unique-class-name-for-adblockers', } as DefaultTemplateProps; export const ConsentNotification = DefaultTemplate.bind({}); diff --git a/src/components/CookieConsent/components/ConsentPopup/ConsentPopup.tsx b/src/components/CookieConsent/components/ConsentPopup/ConsentPopup.tsx index 6ce4b483..570e1d12 100644 --- a/src/components/CookieConsent/components/ConsentPopup/ConsentPopup.tsx +++ b/src/components/CookieConsent/components/ConsentPopup/ConsentPopup.tsx @@ -101,6 +101,7 @@ export const ConsentPopup = ({ policyLink, onAction, className, + modalClassName, policyLinkText = i18n('label_policy_extended'), text, manageLabelText = i18n('manage_label_text_extended'), @@ -156,6 +157,7 @@ export const ConsentPopup = ({ open disableOutsideClick disableEscapeKeyDown + className={modalClassName} contentClassName={b('modal-content', {step: currentStep, mobile})} onClose={onClose} > diff --git a/src/components/CookieConsent/components/ConsentPopup/types.ts b/src/components/CookieConsent/components/ConsentPopup/types.ts index 06571594..108b9e85 100644 --- a/src/components/CookieConsent/components/ConsentPopup/types.ts +++ b/src/components/CookieConsent/components/ConsentPopup/types.ts @@ -40,6 +40,8 @@ export type ConsentPopupProps = ConsentPopupData & CookieConsentBaseProps & { /* Active step */ step?: `${ConsentPopupStep}`; + /* Class for the root Modal node */ + modalClassName?: string; }; export interface HeaderProps {