strapi/public/app/app.js

111 lines
3.6 KiB
JavaScript
Raw Normal View History

2016-08-18 11:41:13 +02:00
/**
* app.js
*
* This is the entry file for the application, only setup and boilerplate
* code.
*/
2016-08-30 11:56:38 +02:00
// import 'babel-polyfill';
2016-08-18 11:41:13 +02:00
/* eslint-disable import/no-unresolved */
2016-08-18 11:47:26 +02:00
// Load the manifest.json file and the .htaccess file
2016-08-30 11:56:38 +02:00
// import '!file?name=[name].[ext]!./manifest.json';
// import 'file?name=[name].[ext]!./.htaccess';
2016-08-18 11:41:13 +02:00
/* eslint-enable import/no-unresolved */
// Import all the third party stuff
2016-08-26 11:47:18 +02:00
// import React from 'react';
// import ReactDOM from 'react-dom';
// import { Provider } from 'react-redux';
// import { applyRouterMiddleware, Router, browserHistory } from 'react-router';
// import { syncHistoryWithStore } from 'react-router-redux';
// import useScroll from 'react-router-scroll';
// import LanguageProvider from 'containers/LanguageProvider';
// import configureStore from './store';
2016-08-18 11:47:26 +02:00
2016-08-26 11:47:18 +02:00
import SettingsManagerHomePage from 'containers/HomePage/index';
2016-08-18 11:41:13 +02:00
2016-08-26 11:47:18 +02:00
// Register the plugin
window.Strapi.registerPlugin({
name: 'Settings Manager',
id: 'settings-manager',
leftMenuLink: {
label: 'Settings Manager',
to: '/settings-manager',
},
mainComponent: SettingsManagerHomePage,
2016-08-18 11:41:13 +02:00
});
2016-08-26 11:47:18 +02:00
// // Import i18n messages
// import { translationMessages } from './i18n';
//
// // Import the CSS reset, which HtmlWebpackPlugin transfers to the build folder
// import 'sanitize.css/sanitize.css';
//
// // 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);
//
// // Sync history and store, as the react-router-redux reducer
// // is under the non-default key ("routing"), selectLocationState
// // must be provided for resolving how to retrieve the "route" in the state
// import { selectLocationState } from 'containers/App/selectors';
// const history = syncHistoryWithStore(browserHistory, store, {
// selectLocationState: selectLocationState(),
// });
//
// // Set up the router, wrapping all Routes in the App component
// import App from 'containers/App';
// import createRoutes from './routes';
// const rootRoute = {
// component: App,
// childRoutes: createRoutes(store),
// };
//
//
// const render = (translatedMessages) => {
// ReactDOM.render(
// <Provider store={store}>
// <LanguageProvider messages={translatedMessages}>
// <Router
// history={history}
// routes={rootRoute}
// render={
// // Scroll to top when going to a new page, imitating default browser
// // behaviour
// applyRouterMiddleware(useScroll())
// }
// />
// </LanguageProvider>
// </Provider>,
// document.getElementById('app')
// );
// };
//
//
// // Hot reloadable translation json files
// if (module.hot) {
// // modules.hot.accept does not accept dynamic dependencies,
// // have to be constants at compile-time
// module.hot.accept('./i18n', () => {
// render(translationMessages);
// });
// }
//
// // Chunked polyfill for browsers without Intl support
// if (!window.Intl) {
// Promise.all([
// System.import('intl'),
// System.import('intl/locale-data/jsonp/en.js'),
// ]).then(() => render(translationMessages));
// } else {
// render(translationMessages);
// }
//
// // Install ServiceWorker and AppCache in the end since
// // it's not most important operation and if main code fails,
// // we do not want it installed
// import { install } from 'offline-plugin/runtime';
// install();