Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROD Deploy 2024-10-03 10:40am EST #192

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion layouts/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import serializeYoastGraph from 'utils/yoast-graph';
import ErrorPage from 'layouts/error';
import PreviewBanner from 'components/preview-banner';

const isOsanoEnabled = process.env.NEXT_PUBLIC_OSANO_ENABLED === 'true';

const Header = dynamic(() => import('components/header'), {
ssr: false,
});
Expand Down Expand Up @@ -148,6 +150,15 @@ export default function Layout(props) {
const canonicalLink = getCanonicalLink(yoast);
const yoastMetaTags = ReactHtmlParser(filterYoastTags(parseYoast(yoast)));

const handleOsanoCookiePreferences = (e) => {
e.preventDefault();

if (isOsanoEnabled) {
// eslint-disable-next-line no-undef
Osano.cm.showDrawer('osano-cm-dom-info-dialog-open');
}
};

return (
<>
<Head>
Expand Down Expand Up @@ -227,7 +238,11 @@ export default function Layout(props) {
renderPage(isError, statusCode, children, preview, language)
)}
</main>
<Footer openContactUsModal={() => setOpen(true)} />
<Footer
showCookiePreferencesLink={isOsanoEnabled}
handleCookiePreferencesClick={handleOsanoCookiePreferences}
openContactUsModal={() => setOpen(true)}
/>
<ContactUsModal open={open} onRequestClose={() => setOpen(false)} />
</>
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@emotion/styled": "^10.0.27",
"@svgr/webpack": "^5.4.0",
"@wordpress/api-fetch": "^3.19.0",
"@worldresources/gfw-components": "^3.5.10",
"@worldresources/gfw-components": "^3.5.11",
"axios": "^0.20.0",
"btoa": "^1.2.1",
"buttercms": "1.2.2",
Expand Down
14 changes: 14 additions & 0 deletions pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ export default class MyDocument extends Document {
)}
{/* End Google Tag Manager (noscript) */}
<Main />
{isOsanoEnabled && (
<script
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
document.addEventListener('DOMContentLoaded', function(event) {
setTimeout(() => {
document.getElementsByClassName('osano-cm-window__widget osano-cm-widget osano-cm-widget--position_right')[0].style.display = 'none';
}, 100);
});
`,
}}
/>
)}
<NextScript />
</body>
</Html>
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1940,10 +1940,10 @@
qs "^6.5.2"
react-native-url-polyfill "^1.1.2"

"@worldresources/gfw-components@^3.5.10":
version "3.5.10"
resolved "https://registry.yarnpkg.com/@worldresources/gfw-components/-/gfw-components-3.5.10.tgz#f15525532b1e7e1747daa619ded53715d3c6b074"
integrity sha512-LQ9qSum4ppXh5tFQ2dnSVLk7hE+y9QbjyGtBlex6her5sSeTF5m4XlAYdaiSg85jatl4p6ZAcq8SZuMuzyCYqg==
"@worldresources/gfw-components@^3.5.11":
version "3.5.11"
resolved "https://registry.yarnpkg.com/@worldresources/gfw-components/-/gfw-components-3.5.11.tgz#ab11df86819057c9a5bb812a1526eaa28e5e4f8e"
integrity sha512-n9gI4xDykAwesTMtmdhOSRrK/QoxVvrDSJsv+Y011qkdmS7b8pVtpRMBIXcF10oC7gf7ZSIR+IM7ApEosPYLnw==
dependencies:
"@artsy/fresnel" "^1.1.0"
"@tippyjs/react" "^4.0.2"
Expand Down
Loading