-
Notifications
You must be signed in to change notification settings - Fork 66
/
index.jsx
executable file
·45 lines (38 loc) · 1.1 KB
/
index.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
import { DiscussionsHome } from './discussions';
import messages from './i18n';
import store from './store';
import './assets/favicon.ico';
import './index.scss';
subscribe(APP_READY, () => {
ReactDOM.render(
<AppProvider store={store}>
<DiscussionsHome />
</AppProvider>,
document.getElementById('root'),
);
});
subscribe(APP_INIT_ERROR, (error) => {
ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));
});
initialize({
requireAuthenticatedUser: true,
messages,
handlers: {
config: () => {
mergeConfig({
LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,
LEARNER_FEEDBACK_URL: process.env.LEARNER_FEEDBACK_URL,
STAFF_FEEDBACK_URL: process.env.STAFF_FEEDBACK_URL,
}, 'DiscussionsConfig');
},
},
});