-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgatsby-browser.tsx
46 lines (39 loc) · 1.04 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
45
46
/**
* 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";
// import { render } from "react-dom";
// import { loadableReady } from "@loadable/component";
// export function replaceHydrateFunction() {
// return (element, container, callback) => {
// loadableReady(() => {
// render(element, container, callback);
// });
// };
// }
export const onClientEntry = (_: any) => {
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 = (_: any) => {
const options = {
margin: 20,
zIndex: 0,
background: "none",
};
mediumZoom(".gatsby-resp-image-image", options);
};
export const onInitialClientRender = () => {
Sign();
};