/* global ROLLBAR_CLIENT_ID ENVIRONMENT */ import React from 'react'; import PropTypes from 'prop-types'; import { Provider } from 'react-redux'; import headComponents from './src/head'; import { createStore } from './src/redux/createStore'; import { CertificationLayout, DefaultLayout, GuideLayout } from './src/components/layouts'; const store = createStore(); export const wrapRootElement = ({ element }) => { return {element}; }; wrapRootElement.propTypes = { element: PropTypes.any }; export const wrapPageElement = ({ element, props }) => { const { location: { pathname } } = props; if (pathname === '/') { return ( {element} ); } if (/^\/certification(\/.*)*/.test(pathname)) { return {element}; } if (/^\/guide(\/.*)*/.test(pathname)) { return ( {element} ); } if (/^\/learn(\/.*)*/.test(pathname)) { return {element}; } return {element}; }; wrapPageElement.propTypes = { element: PropTypes.any, location: PropTypes.objectOf({ pathname: PropTypes.string }), props: PropTypes.any }; export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => { setHeadComponents([...headComponents]); setPostBodyComponents( [ /* eslint-disable max-len */ ENVIRONMENT === 'production' ? (