lbry.tech/app/components/wrapper.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-08-29 01:57:18 +02:00
"use strict";
2018-11-30 21:46:22 +01:00
// I M P O R T
2018-08-29 01:57:18 +02:00
2018-08-29 18:58:55 +02:00
import asyncHtml from "choo-async/html";
2018-08-29 01:57:18 +02:00
2018-10-10 19:56:35 +02:00
// U T I L S
2018-08-29 01:57:18 +02:00
2019-05-13 22:00:44 +02:00
import config from "~root/config";
2018-11-30 21:46:22 +01:00
import footer from "./footer";
import navigation from "./navigation";
2018-08-29 01:57:18 +02:00
// E X P O R T
2018-11-30 21:46:22 +01:00
export default children => (state, emit) => {
return asyncHtml`
<main>
<noscript>
<p>LBRY is quite fancy and relies on a bit of JavaScript to do these fancy things.</p>
<p>Please enable it, if you can.</p>
</noscript>
${navigation(state.href)}
<aside class="flashes" id="flash-container"></aside>
${children.default(state, emit)}
${footer(state, emit)}
</main>
2019-05-13 22:00:44 +02:00
<script>
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,"script","https://www.google-analytics.com/analytics.js","ga");
ga("create", "${config.ga}", "auto");
ga("send", "pageview");
</script>
2018-11-30 21:46:22 +01:00
`;
};