1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-23 09:42:04 +01:00
portfolio/gatsby-browser.js

19 lines
596 B
JavaScript

import './src/styles/global.scss'
import React from 'react'
import AppProvider from './src/store/provider'
import wrapPageElementWithTransition from './src/helpers/wrapPageElement'
// IntersectionObserver polyfill for gatsby-image (Safari, IE)
if (typeof window !== 'undefined' && !window.IntersectionObserver) {
import('intersection-observer')
}
// React Context in Browser
// eslint-disable-next-line
export const wrapRootElement = ({ element }) => {
return <AppProvider>{element}</AppProvider>
}
// Page Transitions & Layout
export const wrapPageElement = wrapPageElementWithTransition