-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,5 @@ | ||
import React from "react" | ||
import { AnimatePresence } from "framer-motion" | ||
// custom typefaces | ||
import "@fontsource-variable/montserrat" | ||
import "@fontsource/merriweather" | ||
// normalize CSS across browsers | ||
import "./src/styles/normalize.css" | ||
// custom CSS styles | ||
import "./src/styles/global.css" | ||
|
||
// Highlighting for code blocks | ||
import "./src/styles/prism-atom-dark.css" | ||
// import { ReactComponent as Background } from "./static/images/background.svg" | ||
|
||
// export const wrapPageElement = ({ element }) => ( | ||
// <> | ||
// {/* <Background | ||
// style={{ | ||
// position: "fixed", | ||
// top: 0, | ||
// left: 0, | ||
// right: 0, | ||
// margin: "auto", | ||
// zIndex: -1, | ||
// }} | ||
// /> */} | ||
|
||
// <AnimatePresence mode="wait">{element}</AnimatePresence> | ||
// </> | ||
// ) | ||
|
||
// must be on Gatsby v2.28 or later -- previous versions had a bug with getSavedScrollPosition that was resolved with v2.28 | ||
// wait until page exit animation has completed before updating scroll position | ||
export const shouldUpdateScroll = ({ | ||
routerProps: { location }, | ||
getSavedScrollPosition, | ||
}) => { | ||
// transition duration from `layout.js` * 1000 to get time in ms | ||
// const TRANSITION_DELAY = 0.3 * 1000 * 2 | ||
|
||
// if it's a "normal" route | ||
// if (location.action === "PUSH") { | ||
// window.setTimeout(() => window.scrollTo(0, 0), TRANSITION_DELAY) | ||
// } | ||
|
||
// if we used the browser's forwards or back button | ||
// else { | ||
// // breaking change in shouldUpdateScroll browser API hook: | ||
// // https://github.com/gatsbyjs/gatsby/issues/23842 | ||
// // looks like they fixed it in Gatsby v. 2.28.1 | ||
// // https://github.com/gatsbyjs/gatsby/pull/27384 | ||
|
||
// const savedPosition = getSavedScrollPosition(location) || [0, 0] | ||
|
||
// window.setTimeout(() => window.scrollTo(...savedPosition), TRANSITION_DELAY) | ||
// } | ||
|
||
return true | ||
} |