regexper-static/gatsby-browser.js

34 lines
905 B
JavaScript
Raw Normal View History

import React from 'react';
import Modal from 'react-modal';
2019-01-04 02:33:13 +00:00
import * as Sentry from '@sentry/browser';
2019-01-06 17:08:37 +00:00
import { I18nextProvider } from 'react-i18next';
2019-01-04 02:33:13 +00:00
2019-01-06 17:08:37 +00:00
import i18n from 'i18n';
import Layout from 'components/Layout';
2019-01-04 02:33:13 +00:00
import 'site.css';
2019-01-19 18:26:13 +00:00
import style from 'globals.module.css';
2019-01-04 02:33:13 +00:00
Modal.setAppElement('#___gatsby');
2019-01-19 18:26:13 +00:00
Modal.defaultProps = {
...Modal.defaultProps,
className: style.modal,
overlayClassName: style.modalOverlay
};
2019-01-04 02:33:13 +00:00
export const onClientEntry = () => {
Sentry.getCurrentHub().getClient().getOptions().enabled =
(navigator.doNotTrack !== '1' && window.doNotTrack !== '1');
};
// eslint-disable-next-line react/prop-types
export const wrapPageElement = ({ element }) => {
return <Layout>{ element }</Layout>;
};
2019-01-06 17:08:37 +00:00
// eslint-disable-next-line react/prop-types
export const wrapRootElement = ({ element }) => {
return <I18nextProvider i18n={ i18n }>{ element }</I18nextProvider>;
};