2019-11-19 07:30:42 +03:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2019-11-20 08:48:27 +03:00
|
|
|
import 'url-search-params-polyfill';
|
2019-11-19 07:30:42 +03:00
|
|
|
|
|
|
|
import Router from './router'
|
2020-07-15 12:14:53 +03:00
|
|
|
import ErrorBoundary from './error-boundary'
|
2019-11-19 07:30:42 +03:00
|
|
|
|
|
|
|
const container = document.getElementById('stats-react-container')
|
|
|
|
|
|
|
|
if (container) {
|
|
|
|
const site = {
|
|
|
|
domain: container.dataset.domain,
|
|
|
|
offset: container.dataset.offset,
|
|
|
|
hasGoals: container.dataset.hasGoals === 'true'
|
|
|
|
}
|
|
|
|
|
2020-07-15 12:14:53 +03:00
|
|
|
const app = (
|
|
|
|
<ErrorBoundary>
|
|
|
|
<Router site={site} />
|
|
|
|
</ErrorBoundary>
|
|
|
|
)
|
|
|
|
|
|
|
|
ReactDOM.render(app, container);
|
2019-11-19 07:30:42 +03:00
|
|
|
}
|