Есть скрипт который обнаруживает блокировщика рекламы, как переписать его методом реакт?
<script>
$(function(){
setTimeout(function() {
var abcount = 0;
var adblockActive = $.cookie('adblockActive');
if (typeof $.ab == 'undefined' || $.ab === undefined) { $.ab = true; }
if ($.ab == true) { abcount = abcount + 1; console.log("method 1"); }
if( !$(".adblockDetect").is(":visible") ){ abcount = abcount + 1; console.log("method 2"); }
if( window.gabchecker == "bingo" ){ abcount = abcount + 1; console.log("method 3"); }
if( abcount == 3 ){
if (adblockActive == undefined) {
$.cookie('adblockActive', 1, { expires: 1, path: '/' });
} else {
$.cookie('adblockActive', parseInt(adblockActive) + 1, { expires: 1, path: '/' });
}
if (adblockActive > 1) {
$("html").addClass("m-blurry");
$(".b-feed-adblock").removeAttr("style");
ga('send', 'event', 'adblock-blur', 'hit', 'adblock-warning');
}
console.log("adblock enabled");
} else {
if ($.cookie('adblockActive') != undefined) {
$.removeCookie('adblockActive', { path: '/' });
ga('send', 'event', 'adblock-blur', 'hit', 'adblock-turn-off');
}
console.log("adblock disabled");
}
console.log("abcount: " + abcount)
}, 500);
$("body").on("click", ".b-feed-adblock__buy", function(){
ga('send', 'event', 'adblock-blur', 'click', 'button-buy');
});
$("body").on("click", ".b-feed-adblock__help", function(){
ga('send', 'event', 'adblock-blur', 'click', 'button-help');
});
});
</script>