Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-plugins/real-cookie-banner/src/public/ts/components/config/consent/list/banner"

Index

Variables

Const ConsentRecordBanner

ConsentRecordBanner: FC<{ onClose: BannerContextProps["onClose"]; record: Consent; visible: boolean }> = observer(({ record, visible, onClose }) => {/* onlypro:start */const [individualPrivacyOpen, setIndividualPrivacyOpen] = useState(false);const { optionStore } = useStores();const {others: { pageRequestUuid4, essentialGroup, bannerI18n, pageByIdUrl }} = optionStore;const {// eslint-disable-next-line @typescript-eslint/naming-conventionviewport_width,// eslint-disable-next-line @typescript-eslint/naming-conventionviewport_height,// eslint-disable-next-line @typescript-eslint/naming-conventionbutton_clicked,tcf_string: tcfString,revision: {data: {groups,tcf,options: { SETTING_EPRIVACY_USA, SETTING_AGE_NOTICE, SETTING_LIST_SERVICES_NOTICE, SETTING_TCF }}},revision_independent: {data: {banner: {customizeValuesBanner: {layout,decision,legal,design,headerDesign,bodyDesign,footerDesign,texts,individualLayout,saveButton,group,individualTexts,customCss,mobile}},tcfMeta,pageIdToPermalink,consentForwardingExternalHosts}}} = record;// TCF compatibilityconst tcfObject = createTcfModel({ tcf, tcfMeta, tcfString });const [tcfFilterBy, setTcfFilterBy] = useState<BannerContextProps["tcfFilterBy"]>("legInt");// Override default functionality so the choices are immutableuseEffect(() => {if (tcfObject?.model) {(["vendorConsents","vendorLegitimateInterests","purposeConsents","purposeLegitimateInterests","specialFeatureOptins"] as Array<keyof typeof tcfObject.model>).map((vector) => tcfObject.model[vector] as Vector).forEach((vector) => {vector.set = function () {throw new TCModelError(`set/unset()`, null, "immutable in list of consents");};vector.unset = vector.set;});}}, [tcfObject]);const handleNotAllowedForRecord = useCallback(() => {// Silence is golden.}, []);// Modify the width and height of the viewportusePlainCss(viewport_width && viewport_height? `#${pageRequestUuid4} {width: ${viewport_width}px;height: ${viewport_height}px;top: 50% !important;left: 50% !important;margin-left: -${viewport_width / 2}px;margin-top: -${viewport_height / 2}px;box-shadow: 0 0 0 3000px rgba(0,0,0,0.95);}`: "");const BannerContext = BannerContextFactory.Context();return (<Portal className="rcb-customize-banner-container"><BannerContext.Providervalue={{layout: { ...layout },decision: { ...decision },legal: { ...legal },design: { ...design },headerDesign: { ...headerDesign },bodyDesign: { ...bodyDesign },footerDesign: { ...footerDesign },texts: { ...texts },individualLayout: { ...individualLayout },saveButton: { ...saveButton },group: { ...group },individualTexts: { ...individualTexts },customCss: { ...customCss },mobile: { ...mobile },pageRequestUuid4,pageIdToPermalink,consentForwardingExternalHosts,pageId: 0,isTcf: !!SETTING_TCF,ePrivacyUSA: !!SETTING_EPRIVACY_USA,ageNotice: !!SETTING_AGE_NOTICE,listServicesNotice: !!SETTING_LIST_SERVICES_NOTICE,tcf: tcfObject,tcfFilterBy,updateTcfFilterBy: (newFilter) => {setTcfFilterBy(newFilter);},groups,pageByIdUrl,essentialGroup,visible,isConsentRecord: true,animationVisible: true,individualPrivacyOpen,// eslint-disable-next-line @typescript-eslint/naming-conventionbuttonClicked: button_clicked,updateIndividualPrivacyOpen: () => {setIndividualPrivacyOpen(true);},i18n: bannerI18n,consent: {groups: record.decision},onClose: () => {setIndividualPrivacyOpen(false);onClose();},didGroupFirstChange: false,updateGroupChecked: handleNotAllowedForRecord,updateCookieChecked: handleNotAllowedForRecord,onSave: handleNotAllowedForRecord}}><Banner /></BannerContext.Provider></Portal>);/* onlypro:end */})

Show a banner from a given record in "Consent" table.

Generated using TypeDoc