2020-07-14 16:52:26 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import Datepicker from './datepicker'
|
2020-08-13 13:45:18 +03:00
|
|
|
import SiteSwitcher from './site-switcher'
|
2020-07-14 16:52:26 +03:00
|
|
|
import Filters from './filters'
|
|
|
|
import CurrentVisitors from './stats/current-visitors'
|
2022-04-13 10:38:47 +03:00
|
|
|
import VisitorGraph from './stats/graph/visitor-graph'
|
2020-08-17 15:13:30 +03:00
|
|
|
import Sources from './stats/sources'
|
2021-07-22 09:12:33 +03:00
|
|
|
import Pages from './stats/pages'
|
2021-10-14 11:55:43 +03:00
|
|
|
import Locations from './stats/locations';
|
2020-07-14 16:52:26 +03:00
|
|
|
import Devices from './stats/devices'
|
|
|
|
import Conversions from './stats/conversions'
|
2020-12-22 16:39:14 +03:00
|
|
|
import { withPinnedHeader } from './pinned-header-hoc';
|
2020-07-14 16:52:26 +03:00
|
|
|
|
2021-12-14 12:28:43 +03:00
|
|
|
function Historical(props) {
|
|
|
|
function renderConversions() {
|
|
|
|
if (props.site.hasGoals) {
|
2020-07-14 16:52:26 +03:00
|
|
|
return (
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full mt-6 md:flex">
|
2021-12-14 12:28:43 +03:00
|
|
|
<Conversions site={props.site} query={props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
2021-07-22 09:12:33 +03:00
|
|
|
|
|
|
|
return null
|
2020-07-14 16:52:26 +03:00
|
|
|
}
|
|
|
|
|
2021-12-14 12:28:43 +03:00
|
|
|
return (
|
|
|
|
<div className="mb-12">
|
|
|
|
<div id="stats-container-top"></div>
|
2022-02-09 00:07:40 +03:00
|
|
|
<div className={`relative top-0 sm:py-3 py-2 z-10 ${props.stuck && !props.site.embedded ? 'sticky fullwidth-shadow bg-gray-50 dark:bg-gray-850' : ''}`}>
|
2021-12-14 12:28:43 +03:00
|
|
|
<div className="items-center w-full flex">
|
|
|
|
<div className="flex items-center w-full">
|
|
|
|
<SiteSwitcher site={props.site} loggedIn={props.loggedIn} currentUserRole={props.currentUserRole} />
|
2023-01-02 18:42:57 +03:00
|
|
|
<CurrentVisitors site={props.site} query={props.query} />
|
2021-12-14 12:28:43 +03:00
|
|
|
<Filters className="flex" site={props.site} query={props.query} history={props.history} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
2021-12-14 12:28:43 +03:00
|
|
|
<Datepicker site={props.site} query={props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-14 12:28:43 +03:00
|
|
|
<VisitorGraph site={props.site} query={props.query} />
|
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
|
|
|
<Sources site={props.site} query={props.query} />
|
|
|
|
<Pages site={props.site} query={props.query} />
|
|
|
|
</div>
|
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
|
|
|
<Locations site={props.site} query={props.query} />
|
|
|
|
<Devices site={props.site} query={props.query} />
|
|
|
|
</div>
|
|
|
|
{ renderConversions() }
|
|
|
|
</div>
|
|
|
|
)
|
2020-07-14 16:52:26 +03:00
|
|
|
}
|
2020-12-22 16:39:14 +03:00
|
|
|
|
2021-03-25 12:55:15 +03:00
|
|
|
export default withPinnedHeader(Historical, '#stats-container-top');
|