From a069185c9ac0ea7a347187545539fc1052411f95 Mon Sep 17 00:00:00 2001 From: Jason Gill Date: Tue, 9 Apr 2024 09:08:33 -0600 Subject: [PATCH] update constant to be generic --- clients/fides-js/src/components/LanguageSelector.tsx | 4 ++-- clients/fides-js/src/components/Overlay.tsx | 4 ++-- clients/fides-js/src/lib/consent-constants.ts | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/clients/fides-js/src/components/LanguageSelector.tsx b/clients/fides-js/src/components/LanguageSelector.tsx index c1db579490..0464f4aab0 100644 --- a/clients/fides-js/src/components/LanguageSelector.tsx +++ b/clients/fides-js/src/components/LanguageSelector.tsx @@ -3,7 +3,7 @@ import { I18n } from "../lib/i18n"; import { useI18n } from "../lib/i18n/i18n-context"; import { debugLog, FidesInitOptions } from "../fides"; import MenuItem from "./MenuItem"; -import { FIDES_A11Y_CONSTANTS } from "../lib/consent-constants"; +import { FIDES_OVERLAY_WRAPPER } from "../lib/consent-constants"; interface LanguageSelectorProps { i18n: I18n; @@ -17,7 +17,7 @@ const LanguageSelector = ({ i18n, options }: LanguageSelectorProps) => { if (locale !== i18n.locale) { i18n.activate(locale); setCurrentLocale(locale); - document.getElementById(FIDES_A11Y_CONSTANTS.FIDES_REFOCUS_EL)?.focus(); + document.getElementById(FIDES_OVERLAY_WRAPPER)?.focus(); debugLog(options.debug, `Fides locale updated to ${locale}`); } }; diff --git a/clients/fides-js/src/components/Overlay.tsx b/clients/fides-js/src/components/Overlay.tsx index 519b37f3f5..b2ae6120e6 100644 --- a/clients/fides-js/src/components/Overlay.tsx +++ b/clients/fides-js/src/components/Overlay.tsx @@ -28,7 +28,7 @@ import ConsentModal from "./ConsentModal"; import ConsentContent from "./ConsentContent"; import "./fides.css"; import { blockPageScrolling, unblockPageScrolling } from "../lib/ui-utils"; -import { FIDES_A11Y_CONSTANTS } from "../lib/consent-constants"; +import { FIDES_OVERLAY_WRAPPER } from "../lib/consent-constants"; interface RenderBannerProps { isOpen: boolean; @@ -192,7 +192,7 @@ const Overlay: FunctionComponent = ({ } return ( -
+
{showBanner && bannerIsOpen && isUiBlocking && (
)} diff --git a/clients/fides-js/src/lib/consent-constants.ts b/clients/fides-js/src/lib/consent-constants.ts index 4e547ecc52..994e91d1cc 100644 --- a/clients/fides-js/src/lib/consent-constants.ts +++ b/clients/fides-js/src/lib/consent-constants.ts @@ -104,6 +104,4 @@ export const FIDES_OVERRIDE_EXPERIENCE_LANGUAGE_VALIDATOR_MAP: { }, ]; -export const FIDES_A11Y_CONSTANTS = { - FIDES_REFOCUS_EL: "fides-refocus-el", -}; +export const FIDES_OVERLAY_WRAPPER = "fides-overlay-wrapper";