summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/index.js
blob: fdfec24b75f2bfbc906d024cace5e2721c2e50fe (plain)
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
import React from 'react'
import ReactDOM from 'react-dom'
import * as Sentry from '@sentry/react'
import { Integrations } from '@sentry/tracing'
import { Provider } from 'react-redux'
import './index.scss'
import Routes from './routes'
import config from './config'
import configureStore from './store/configure-store'

const store = configureStore()

// Initialize Sentry if the user has configured a DSN
const dsn = config['SENTRY_DSN']
if (dsn) {
    Sentry.init({
        environment: process.env.NODE_ENV,
        dsn: dsn,
        integrations: [new Integrations.BrowserTracing()],
        tracesSampleRate: 0.1,
    })
}

ReactDOM.render(
    <Provider store={store}>
        <Routes />
    </Provider>,
    document.getElementById('root')
)