mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-02-04 01:32:54 +08:00
fix carbonads
This commit is contained in:
parent
87fba5e410
commit
b8a027ab57
@ -1,3 +1,4 @@
|
|||||||
|
import Script from "next/script";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
@ -32,13 +33,25 @@ export const CarbonAds: React.FC<{ editor?: boolean }> = ({
|
|||||||
editor = false,
|
editor = false,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<StyledWrapper editor={editor}>
|
<StyledWrapper editor={editor} id="carbon-wrapper">
|
||||||
<script
|
<Script
|
||||||
defer
|
|
||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
src="//cdn.carbonads.com/carbon.js?serve=CE7IPKQL&placement=jsonvisiocom"
|
src="//cdn.carbonads.com/carbon.js?serve=CE7IPKQL&placement=jsonvisiocom"
|
||||||
id="_carbonads_js"
|
id="_carbonads_js"
|
||||||
></script>
|
strategy="lazyOnload"
|
||||||
|
onLoad={() => {
|
||||||
|
const init = () => {
|
||||||
|
const parent = document.getElementById("carbon-wrapper");
|
||||||
|
const ads = document.getElementById("carbonads");
|
||||||
|
|
||||||
|
if (ads === null) return setTimeout(() => init(), 500);
|
||||||
|
|
||||||
|
parent?.appendChild(ads);
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</StyledWrapper>
|
</StyledWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user