Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gilluminate committed Aug 16, 2024
1 parent 980731f commit 56185d3
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions clients/fides-js/src/components/ConsentModal.tsx
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ const ConsentModal = ({
children,
dismissable,
i18n,
onVendorPageClick,
renderModalFooter,
}: {
attributes: Attributes;
@@ -46,6 +47,7 @@ const ConsentModal = ({
titleProps={title}
i18n={i18n}
renderModalFooter={renderModalFooter}
onVendorPageClick={onVendorPageClick}
>
{children}
</ConsentContent>
9 changes: 7 additions & 2 deletions clients/fides-js/src/components/ExperienceDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-template-curly-in-string */
import { h } from "preact";
import { useContext } from "preact/hooks";

import { useVendorButton } from "../lib/tcf/vendor-button-context";
import { VendorButtonContext } from "../lib/tcf/vendor-button-context";

const VENDOR_COUNT_LINK = "${VENDOR_COUNT_LINK}";

@@ -14,7 +15,11 @@ const ExperienceDescription = ({
onVendorPageClick?: () => void;
allowHTMLDescription?: boolean | null;
}) => {
const { vendorCount } = useVendorButton();
let vendorCount = 0;
const context = useContext(VendorButtonContext);
if (context?.vendorCount) {
vendorCount = context.vendorCount;
}

if (!description) {
return null;
2 changes: 1 addition & 1 deletion clients/fides-js/src/lib/tcf/vendor-button-context.tsx
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ interface VendorButtonContextProps {
setVendorCount: Dispatch<StateUpdater<number | undefined>>;
}

const VendorButtonContext = createContext<
export const VendorButtonContext = createContext<
VendorButtonContextProps | Record<any, never>
>({});

0 comments on commit 56185d3

Please sign in to comment.