site/gatsby-ssr.js
2020-01-15 17:45:50 +03:00

75 lines
2.0 KiB
JavaScript

import React from "react";
export function onRenderBody(
{ setHeadComponents, setPostBodyComponents }
) {
setHeadComponents([
<script
key="head0"
type="text/css"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css"
/>,
<script
key="head1"
type="text/javascript"
src="https://cdn.plot.ly/plotly-latest.min.js"
/>,
// <script
// key="head2"
// type="text/javascript"
// src="./main.bundle.js"
// />,
<script
key="head3"
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid.min.css"
/>,
<script
key="head4"
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid-theme.min.css"
/>,
<script
key="head5"
type="text/javascript"
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
/>,
<script
key="head6"
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid.min.js"
/>,
<script
dangerouslySetInnerHTML={{
__html: `
var tooltip = false;
function toggleHelp() {
tooltip = !tooltip;
if (tooltip) {
$(function () {
$('[data-toggle="tooltip"]').tooltip('show')
})
} else {
$(function () {
$('[data-toggle="tooltip"]').tooltip('hide')
})
}
}
`
}}
/>
]);
setPostBodyComponents([
<script
key="postbody1"
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
/>,
<script
key="postbody1"
type="text/javascript"
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js"
/>,
]);
}