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-08-13 13:45:18 +03:00
|
|
|
const loggedIn = container.dataset.loggedIn === 'true'
|
|
|
|
|
2020-07-15 12:14:53 +03:00
|
|
|
const app = (
|
|
|
|
<ErrorBoundary>
|
2020-08-13 13:45:18 +03:00
|
|
|
<Router site={site} loggedIn={loggedIn} />
|
2020-07-15 12:14:53 +03:00
|
|
|
</ErrorBoundary>
|
|
|
|
)
|
|
|
|
|
|
|
|
ReactDOM.render(app, container);
|
2019-11-19 07:30:42 +03:00
|
|
|
}
|