strapi/public/app/app.js

39 lines
979 B
JavaScript
Raw Normal View History

2016-08-18 11:41:13 +02:00
/**
* app.js
*
2016-10-05 13:48:49 +02:00
* This is the entry file for the application, only setup and plugin
2016-08-18 11:41:13 +02:00
* code.
*/
2016-09-06 17:44:06 +02:00
import { browserHistory } from 'react-router';
2016-09-02 17:52:34 +02:00
import configureStore from './store';
2016-08-18 11:47:26 +02:00
2016-09-02 17:52:34 +02:00
// Create redux store with history
// this uses the singleton browserHistory provided by react-router
// Optionally, this could be changed to leverage a created history
// e.g. `const browserHistory = useRouterHistory(createBrowserHistory)();`
const initialState = {};
const store = configureStore(initialState, browserHistory);
// Set up the router, wrapping all Routes in the App component
import App from 'containers/App';
import createRoutes from './routes';
// Register the plugin
2016-10-04 17:49:40 +02:00
if (window.Strapi) {
window.Strapi.registerPlugin({
name: 'Settings Manager',
id: 'settings-manager',
leftMenuLink: {
label: 'Settings Manager',
to: '/settings-manager',
},
mainComponent: App,
2016-10-05 13:48:49 +02:00
routes: createRoutes(store),
2016-10-04 17:49:40 +02:00
});
}
2016-10-05 13:48:49 +02:00
// Export store
export {
store,
};