forked from neonick/krddevdays.ru
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHtml.js
More file actions
83 lines (77 loc) · 2.99 KB
/
Html.js
File metadata and controls
83 lines (77 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import React from 'react'
import PropTypes from 'prop-types'
import Head from 'react-helmet'
const Html = (props) => {
const helmet = Head.renderStatic()
return (
<html {...helmet.htmlAttributes.toComponent()}>
<head>
{helmet.base.toComponent()}
{helmet.title.toComponent()}
{helmet.meta.toComponent()}
{helmet.link.toComponent()}
{typeof window === 'undefined' && require('./ServerStyleSheet').default.getStyleElement()}
{helmet.script.toComponent()}
{helmet.noscript.toComponent()}
<script
type='text/javascript'
dangerouslySetInnerHTML={{__html: `(window.Image ? (new Image()) : document.createElement('img')).src = 'https://vk.com/rtrg?p=VK-RTRG-140553-fXIvj';`}} />
</head>
<body {...helmet.bodyAttributes.toComponent()}>
{props.body}
{props.state}
{props.script}
<script type='text/javascript' dangerouslySetInnerHTML={{
__html: `
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter44994376 = new Ya.Metrika({
id:44994376,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true,
trackHash:true
});
} catch(e) { }
});
var n = d.getElementsByTagName('script')[0],
s = d.createElement('script'),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = 'text/javascript';
s.async = true;
s.src = 'https://mc.yandex.ru/metrika/watch.js';
if (w.opera == '[object Opera]') {
d.addEventListener('DOMContentLoaded', f, false);
} else { f(); }
})(document, window, 'yandex_metrika_callbacks');
`
}} />
<script type='text/javascript' dangerouslySetInnerHTML={{
__html: `
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1948331748778465'); // Insert your pixel ID here.
fbq('track', 'PageView');
`
}} />
<noscript
dangerouslySetInnerHTML={{__html: `
<img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=1948331748778465&ev=PageView&noscript=1'/>
`}} />
<noscript
dangerouslySetInnerHTML={{__html: `<img src='https://mc.yandex.ru/watch/44994376' style='position: absolute; left: -9999px' alt='' />`}} />
</body>
</html>
)
}
Html.propTypes = {
body: PropTypes.any,
state: PropTypes.any,
script: PropTypes.any
}
export default Html