-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
74 lines (64 loc) · 1.98 KB
/
index.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import 'antd/dist/antd.css';
import './assets/css/styles.css';
import store from './app/redux/store';
import App from './app/App.js';
import App403 from './app/App403.js';
import {registerServiceWorker, unregister} from './registerServiceWorker';
import firebase from 'firebase/app';
import { ReactReduxFirebaseProvider } from 'react-redux-firebase';
import { message } from 'antd';
const config = {
projectId: "rog-2-0",
apiKey: "AIzaSyCY1oTVrozQfDrCG1k-b3Q4Iw5iWSF_LIM",
appId: "1:153344187169:web:64dd90de0f9831cc643c60",
messagingSenderId: "153344187169"
};
const rrfConfig = {
userProfile: 'users'
};
const rrfProps = {
firebase: firebase,
config: rrfConfig,
dispatch: store.dispatch
}
firebase.initializeApp(config);
const isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
if ((window.location.protocol + '//' + window.location.host) == 'https://dev.monitor.gorog.co' || (window.location.protocol + '//' + window.location.host) == 'https://stage.monitor.gorog.co') {
var credentials = window.prompt("Enter Realm Password");
if (!credentials|| credentials !== 'GoRogTeam!') {
render403();
} else {
renderApp();
}
} else {
renderApp();
}
function renderApp() {
if (!isChrome) {
message.warning("ROG supports Google Chrome. Other web browsers are not currently supported.", 10);
}
console.log("Version 2.1");
registerServiceWorker();
// unregister();
const ReduxApp = () => (
<Provider store={store}>
<ReactReduxFirebaseProvider {...rrfProps}>
<App/>
</ReactReduxFirebaseProvider>
</Provider>
)
ReactDOM.render(<ReduxApp />, document.getElementById('root'));
}
function render403() {
registerServiceWorker();
// unregister();
const ErrorApp = () => (
<Provider store={store}>
<App403 />
</Provider>
)
ReactDOM.render(<ErrorApp />, document.getElementById('root'));
}