1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-21 12:17:20 +02:00

37 lines
901 B
JavaScript
Raw Normal View History

2024-10-09 20:52:28 +03:00
import React, { useEffect } from 'react';
import Layout from '@theme-original/Layout';
import Head from '@docusaurus/Head';
export default function CustomLayout(props) {
useEffect(() => {
const script = document.createElement('script');
script.innerHTML = `
2024-10-09 22:42:09 +03:00
window.yaContextCb.push(() => {
Ya.Context.AdvManager.render({
"blockId": "R-A-12294791-3",
"type": "floorAd",
"platform": "touch"
})
})
2024-10-09 20:52:28 +03:00
`;
document.body.appendChild(script);
// Удаляем элементы при размонтировании компонента
return () => {
2024-10-09 21:17:02 +03:00
script.remove();
2024-10-09 20:52:28 +03:00
};
}, []);
return (
<>
<Head>
<script>
window.yaContextCb = window.yaContextCb || [];
</script>
<script src="https://yandex.ru/ads/system/context.js" async></script>
</Head>
<Layout {...props} />
</>
);
}