39 lines
859 B
JavaScript
Executable File
39 lines
859 B
JavaScript
Executable File
import 'core-js/stable';
|
|
import 'regenerator-runtime/runtime';
|
|
|
|
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import {
|
|
APP_INIT_ERROR, APP_READY, initialize, mergeConfig, subscribe,
|
|
} from '@edx/frontend-platform';
|
|
import { ErrorPage } from '@edx/frontend-platform/react';
|
|
import { messages as paragonMessages } from '@edx/paragon';
|
|
|
|
import configuration from './config';
|
|
import appMessages from './i18n';
|
|
import MainApp from './MainApp';
|
|
|
|
subscribe(APP_READY, () => {
|
|
ReactDOM.render(
|
|
<MainApp />,
|
|
document.getElementById('root'),
|
|
);
|
|
});
|
|
|
|
subscribe(APP_INIT_ERROR, (error) => {
|
|
ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));
|
|
});
|
|
|
|
initialize({
|
|
handlers: {
|
|
config: () => {
|
|
mergeConfig(configuration);
|
|
},
|
|
},
|
|
messages: [
|
|
appMessages,
|
|
paragonMessages,
|
|
],
|
|
});
|