-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgatsby-browser.tsx
44 lines (37 loc) · 1 KB
/
gatsby-browser.tsx
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
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/
// You can delete this file if you're not using it
import mediumZoom from "medium-zoom";
import { Sign } from "./src/utils/Sign.tsx";
export const onClientEntry = () => {
const styles = `
.medium-zoom-overlay, .medium-zoom-image {
z-index: 0;
}
`;
const node = document.createElement(`style`);
node.id = `medium-zoom-styles`;
node.innerHTML = styles;
document.head.appendChild(node);
};
export const onRouteUpdate = () => {
const options = {
margin: 20,
zIndex: 0,
background: "none",
};
mediumZoom(".gatsby-resp-image-image", options);
if (navigator.clipboard && window.isSecureContext) {
return;
}
const elementNodeListOf = document.querySelectorAll(".gatsby-remark-prismjs-copy-button-container");
elementNodeListOf.forEach((el) => {
(el as HTMLElement).style.display = "none";
});
};
export const onInitialClientRender = () => {
Sign();
};