mirror of
https://github.com/plausible/analytics.git
synced 2024-12-20 16:11:49 +03:00
cda031d453
* Implement shared links with a static URL * Separate sessio cookie from shared link cookie
33 lines
819 B
JavaScript
33 lines
819 B
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'
|
|
|
|
const container = document.getElementById('stats-react-container')
|
|
|
|
if (container) {
|
|
const site = {
|
|
domain: container.dataset.domain,
|
|
offset: container.dataset.offset,
|
|
hasGoals: container.dataset.hasGoals === 'true',
|
|
insertedAt: container.dataset.insertedAt
|
|
}
|
|
|
|
const loggedIn = container.dataset.loggedIn === 'true'
|
|
const sharedLinkAuth = container.dataset.sharedLinkAuth
|
|
if (sharedLinkAuth) {
|
|
api.setSharedLinkAuth(sharedLinkAuth)
|
|
}
|
|
|
|
const app = (
|
|
<ErrorBoundary>
|
|
<Router site={site} loggedIn={loggedIn} />
|
|
</ErrorBoundary>
|
|
)
|
|
|
|
ReactDOM.render(app, container);
|
|
}
|