diff --git a/package-lock.json b/package-lock.json index f500a2d4d..c40612418 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "lodash.merge": "4.6.2", "lodash.snakecase": "4.1.1", "pubsub-js": "1.9.4", - "react-intl": "5.25.1", + "react-intl": "^5.25.1", "universal-cookie": "4.0.4" }, "bin": { @@ -4241,9 +4241,9 @@ } }, "node_modules/@testing-library/dom": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.1.tgz", - "integrity": "sha512-0DGPd9AR3+iDTjGoMpxIkAsUihHZ3Ai6CneU6bRRrffXMgzCdlNk43jTrD2/5LT6CBb3MWTP8v510JzYtahD2w==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", + "integrity": "sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==", "dev": true, "peer": true, "dependencies": { @@ -14598,9 +14598,9 @@ } }, "node_modules/jquery": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", - "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", "dev": true, "peer": true }, diff --git a/package.json b/package.json index 7438b29ec..fc86bb9d2 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "lodash.merge": "4.6.2", "lodash.snakecase": "4.1.1", "pubsub-js": "1.9.4", - "react-intl": "5.25.1", + "react-intl": "^5.25.1", "universal-cookie": "4.0.4" }, "peerDependencies": { diff --git a/src/react/AppProvider.jsx b/src/react/AppProvider.jsx index f91c7529b..7c372d82c 100644 --- a/src/react/AppProvider.jsx +++ b/src/react/AppProvider.jsx @@ -89,6 +89,8 @@ export default function AppProvider({ store, children }) { return null; } + console.log({locale}); + return ( diff --git a/src/react/hooks/paragon/useParagonThemeCore.js b/src/react/hooks/paragon/useParagonThemeCore.js index f1090d52e..678a31312 100644 --- a/src/react/hooks/paragon/useParagonThemeCore.js +++ b/src/react/hooks/paragon/useParagonThemeCore.js @@ -34,11 +34,11 @@ const useParagonThemeCore = ({ setIsBrandThemeCoreLoaded(true); return; } - const getParagonThemeCoreLink = () => document.head.querySelector('link[data-paragon-theme-core="true"'); - const existingCoreThemeLink = document.head.querySelector(`link[href='${themeCore.urls.default}']`); + const getParagonThemeCoreLink = () => document.head.querySelector('link[data-paragon-theme-core="true"][rel=stylesheet]'); + const existingCoreThemeLink = document.head.querySelector(`link[href='${themeCore.urls.default}'][rel=stylesheet]`); if (!existingCoreThemeLink) { const getExistingCoreThemeLinks = (isBrandOverride) => { - const coreThemeLinkSelector = `link[data-${isBrandOverride ? 'brand' : 'paragon'}-theme-core="true"]`; + const coreThemeLinkSelector = `link[data-${isBrandOverride ? 'brand' : 'paragon'}-theme-core="true"][rel=stylesheet]`; return document.head.querySelectorAll(coreThemeLinkSelector); }; const createCoreThemeLink = ( @@ -131,3 +131,4 @@ const useParagonThemeCore = ({ }; export default useParagonThemeCore; + diff --git a/src/react/hooks/paragon/useParagonThemeVariants.js b/src/react/hooks/paragon/useParagonThemeVariants.js index efb8ef4c5..fbff06009 100644 --- a/src/react/hooks/paragon/useParagonThemeVariants.js +++ b/src/react/hooks/paragon/useParagonThemeVariants.js @@ -77,12 +77,12 @@ const useParagonThemeVariants = ({ setIsBrandThemeVariantLoaded(true); return; } - const getParagonThemeVariantLink = () => document.head.querySelector(`link[data-paragon-theme-variant='${themeVariant}']`); - const existingThemeVariantLink = document.head.querySelector(`link[href='${value.urls.default}']`); - const existingThemeVariantBrandLink = document.head.querySelector(`link[href='${value.urls.brandOverride}']`); + const getParagonThemeVariantLink = () => document.head.querySelector(`link[data-paragon-theme-variant='${themeVariant}'][rel=stylesheet]`); + const existingThemeVariantLink = document.head.querySelector(`link[href='${value.urls.default}'][rel=stylesheet]`); + const existingThemeVariantBrandLink = document.head.querySelector(`link[href='${value.urls.brandOverride}'][rel=stylesheet]`); const getExistingThemeVariantLinks = (isBrandOverride) => { - const themeVariantLinkSelector = `link[data-${isBrandOverride ? 'brand' : 'paragon'}-theme-variant='${themeVariant}']`; + const themeVariantLinkSelector = `link[data-${isBrandOverride ? 'brand' : 'paragon'}-theme-variant='${themeVariant}'][rel=stylesheet]`; return document.head.querySelectorAll(themeVariantLinkSelector); };