UNPKG

cluedin-widget

Version:

This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.

62 lines (55 loc) 1.6 kB
import App from './App.jsx'; import ReactDOM from 'react-dom'; import React from 'react'; import { IntlProvider } from 'react-intl'; import { createStore, applyMiddleware, combineReducers } from 'redux'; import { Provider } from 'react-redux'; import thunkMiddleware from 'redux-thunk'; import createLogger from 'redux-logger'; import { getCurrentToken, clientId } from '../../core/config'; import reducers from '../../core/reducers'; import localesInfo from '../../locales/en.js'; import { StyleRoot, Style } from 'radium'; const loggerMiddleware = createLogger(); const cluedIn = window.__cluedIn || {}; const createStoreWithMiddleware = applyMiddleware( thunkMiddleware, loggerMiddleware, )(createStore); const initialState = { core: { token: getCurrentToken(), widgetConfiguration: void 0, org: clientId, connectedData: [], unauthorized: false, isFetchingConnectedData: true, }, }; const AppStyle = { color: '#222', fontFamily: 'Sans-Serif', a: { color: '#222', }, }; const reducer = combineReducers(Object.assign({}, reducers)); const store = createStoreWithMiddleware(reducer, initialState); cluedIn.injectChromePlugin = (DOMElement) => { ReactDOM.render( <Provider store={store}> <IntlProvider locale={localesInfo.locale} messages={localesInfo.messages}> <div className="root"> <StyleRoot> <Style scopeSelector=".root" rules={AppStyle} /> <App /> </StyleRoot> </div> </IntlProvider> </Provider>, DOMElement ); };