Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Import root containers
import Root from './app';
// Import analytics HOC
import analytics from './analytics';
// Import i18n messages
import { translationMessages } from './i18n';
// Observe loading of Open Sans (to remove open sans, remove the tag in
// the index.html file and this observer)
const openSansObserver = new FontFaceObserver('Open Sans', {});
// Initialize hotjar with our tracking code
hotjar.initialize('793002');
// When Open Sans is loaded, add a font-family using Open Sans to the body
openSansObserver.load().then(() => {
document.body.classList.add('fontLoaded');
}, () => {
document.body.classList.remove('fontLoaded');
});
// Create redux store with history and hydrate state from server, if available
// eslint-disable-next-line no-underscore-dangle
const initialState = window.__SERVER_STATE || {};
const initialStateAllowedKeys = new Set(['global', 'language', 'route']);
const history = createHistory();
const store = configureStore(Object.keys(initialState).filter((k) =>
initialStateAllowedKeys.has(k)
).reduce((acc, key) => ({
import Routes from './routes'
const history = createHistory()
const store = configureStore(history, {})
const initializeReactGA = ({ trackingId = 'test', debug } = {}) => {
const id = trackingId === '' ? 'test' : trackingId
ReactGA.initialize(id, { debug })
ReactGA.pageview('/')
}
initializeReactGA(config.googleAnalytics)
if (config.hotJar.enabled) {
hotjar.initialize(config.hotJar.id, config.hotJar.snippetVersion)
}
const makeApolloConfig = ({ cache, link }) => {
const clientStateLink = withClientState({
cache,
...authorSchema.clientStateConfig,
})
return {
cache,
link: clientStateLink.concat(link),
...config,
}
}
const App = () => (