Skip to content

Commit

Permalink
feat(CookieConsent): add modalClassName property to ConsentPopup
Browse files Browse the repository at this point in the history
…Modal (#230)
  • Loading branch information
danonechik94 authored Oct 22, 2024
1 parent 0a7854b commit 58b64e6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/CookieConsent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const Analytics = () => {
consentManager={consentManager}
cookieList={cookieList}
onConsentPopupClose={props.onClose}
modalClassName={'unique-class-name-for-adblockers'}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({});
Expand All @@ -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({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export const ConsentPopup = ({
policyLink,
onAction,
className,
modalClassName,
policyLinkText = i18n('label_policy_extended'),
text,
manageLabelText = i18n('manage_label_text_extended'),
Expand Down Expand Up @@ -156,6 +157,7 @@ export const ConsentPopup = ({
open
disableOutsideClick
disableEscapeKeyDown
className={modalClassName}
contentClassName={b('modal-content', {step: currentStep, mobile})}
onClose={onClose}
>
Expand Down
2 changes: 2 additions & 0 deletions src/components/CookieConsent/components/ConsentPopup/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export type ConsentPopupProps = ConsentPopupData &
CookieConsentBaseProps & {
/* Active step */
step?: `${ConsentPopupStep}`;
/* Class for the root Modal node */
modalClassName?: string;
};

export interface HeaderProps {
Expand Down

0 comments on commit 58b64e6

Please sign in to comment.