-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-browser.js
31 lines (30 loc) · 916 Bytes
/
gatsby-browser.js
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
import "./src/styles/normalize.css"
import "./src/styles/global.scss"
// const transitionDelay = 250
//
// export const shouldUpdateScroll =
// ({
// routerProps: { location },
// getSavedScrollPosition,
// }) => {
// if (location.action === "PUSH") {
// window.setTimeout(() => window.scrollTo(0, 0), transitionDelay)
// } else {
// if (location.hash) {
// window.setTimeout(scrollTo(location.hash), 10)
// } else {
// const savedPosition = getSavedScrollPosition(location)
// window.setTimeout(
// () => window.scrollTo(...(savedPosition || [0, 0])),
// transitionDelay,
// )
// }
// }
// return false
// }
//
// /* global window, document */
// const scrollTo = (id) => () => {
// const el = document.querySelector(id)
// if (el) window.scrollTo({ top: el.offsetTop - 40, behavior: "smooth" })
// }