1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-11-15 01:25:25 +01:00
portfolio/gatsby-browser.js

25 lines
677 B
JavaScript
Raw Normal View History

2018-09-16 21:33:42 +02:00
import React from 'react'
2019-04-28 22:30:20 +02:00
import PropTypes from 'prop-types'
import AppProvider from './src/store/AppProvider'
import wrapPageElementWithLayout from './src/helpers/wrapPageElement'
// Global styles
import './src/styles/global.scss'
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
export const wrapRootElement = ({ element }) => {
return <AppProvider>{element}</AppProvider>
}
2019-04-28 22:30:20 +02:00
wrapRootElement.propTypes = {
element: PropTypes.any
}
// Layout with Page Transitions
export const wrapPageElement = wrapPageElementWithLayout