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
Raw Normal View History

2018-09-24 00:13:41 +02:00
import './src/styles/global.scss'
2018-09-16 21:33:42 +02:00
import React from 'react'
import AppProvider from './src/store/provider'
2018-09-14 18:27:49 +02:00
import wrapPageElementWithTransition from './src/helpers/wrapPageElement'
2018-06-23 14:36:07 +02:00
2018-09-14 18:27:49 +02:00
// IntersectionObserver polyfill for gatsby-image (Safari, IE)
if (typeof window !== 'undefined' && !window.IntersectionObserver) {
import('intersection-observer')
2018-06-23 14:36:07 +02:00
}
2018-09-14 18:27:49 +02:00
2018-09-16 21:33:42 +02:00
// React Context in Browser
// eslint-disable-next-line
export const wrapRootElement = ({ element }) => {
return <AppProvider>{element}</AppProvider>
}
2018-09-14 20:22:57 +02:00
// Page Transitions & Layout
2018-09-14 18:27:49 +02:00
export const wrapPageElement = wrapPageElementWithTransition