mirror of
https://github.com/plausible/analytics.git
synced 2024-12-21 08:31:29 +03:00
c7b8a8ef27
* Revert "Revert "UI groundwork: Conversions to Behaviors (#3005)" (#3024)"
This reverts commit dc0853bac7
.
* Move ref back to LazyLoader container
47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import 'url-search-params-polyfill';
|
|
|
|
import Router from './router'
|
|
import ErrorBoundary from './error-boundary'
|
|
import * as api from './api'
|
|
import * as timer from './util/realtime-update-timer'
|
|
|
|
timer.start()
|
|
|
|
const container = document.getElementById('stats-react-container')
|
|
|
|
if (container) {
|
|
const site = {
|
|
domain: container.dataset.domain,
|
|
offset: container.dataset.offset,
|
|
hasGoals: container.dataset.hasGoals === 'true',
|
|
conversionsEnabled: container.dataset.conversionsEnabled === 'true',
|
|
funnelsEnabled: container.dataset.funnelsEnabled === 'true',
|
|
propsEnabled: container.dataset.propsEnabled === 'true',
|
|
funnels: JSON.parse(container.dataset.funnels),
|
|
statsBegin: container.dataset.statsBegin,
|
|
nativeStatsBegin: container.dataset.nativeStatsBegin,
|
|
embedded: container.dataset.embedded,
|
|
background: container.dataset.background,
|
|
isDbip: container.dataset.isDbip === 'true',
|
|
flags: JSON.parse(container.dataset.flags),
|
|
validIntervalsByPeriod: JSON.parse(container.dataset.validIntervalsByPeriod)
|
|
}
|
|
|
|
const loggedIn = container.dataset.loggedIn === 'true'
|
|
const currentUserRole = container.dataset.currentUserRole
|
|
const sharedLinkAuth = container.dataset.sharedLinkAuth
|
|
if (sharedLinkAuth) {
|
|
api.setSharedLinkAuth(sharedLinkAuth)
|
|
}
|
|
|
|
const app = (
|
|
<ErrorBoundary>
|
|
<Router site={site} loggedIn={loggedIn} currentUserRole={currentUserRole} />
|
|
</ErrorBoundary>
|
|
)
|
|
|
|
ReactDOM.render(app, container);
|
|
}
|