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'
|
|
|
|
import VisitorGraph from './stats/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
|
|
|
|
2020-12-22 16:39:14 +03:00
|
|
|
class Historical extends React.Component {
|
2020-07-14 16:52:26 +03:00
|
|
|
renderConversions() {
|
|
|
|
if (this.props.site.hasGoals) {
|
|
|
|
return (
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full mt-6 md:flex">
|
2020-07-14 16:52:26 +03:00
|
|
|
<Conversions site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
2021-07-22 09:12:33 +03:00
|
|
|
|
|
|
|
return null
|
2020-07-14 16:52:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2021-03-16 11:40:25 +03:00
|
|
|
const navClass = this.props.site.embedded ? 'relative' : 'sticky'
|
|
|
|
|
2020-07-14 16:52:26 +03:00
|
|
|
return (
|
|
|
|
<div className="mb-12">
|
2020-12-22 16:39:14 +03:00
|
|
|
<div id="stats-container-top"></div>
|
2021-09-21 12:08:00 +03:00
|
|
|
<div className={`${navClass} top-0 sm:py-3 py-2 z-10 ${this.props.stuck && !this.props.site.embedded ? 'fullwidth-shadow bg-gray-50 dark:bg-gray-850' : ''}`}>
|
2021-07-21 16:50:26 +03:00
|
|
|
<div className="items-center w-full flex">
|
|
|
|
<div className="flex items-center w-full">
|
2021-06-16 15:00:07 +03:00
|
|
|
<SiteSwitcher site={this.props.site} loggedIn={this.props.loggedIn} currentUserRole={this.props.currentUserRole} />
|
2020-12-29 12:00:41 +03:00
|
|
|
<CurrentVisitors timer={this.props.timer} site={this.props.site} query={this.props.query} />
|
2021-07-22 09:12:33 +03:00
|
|
|
<Filters className="flex" site={this.props.site} query={this.props.query} history={this.props.history} />
|
2021-07-21 16:50:26 +03:00
|
|
|
</div>
|
2021-07-22 11:27:10 +03:00
|
|
|
<Datepicker site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<VisitorGraph site={this.props.site} query={this.props.query} />
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
2020-08-17 15:13:30 +03:00
|
|
|
<Sources site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
<Pages site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
2021-10-14 11:55:43 +03:00
|
|
|
<Locations site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
<Devices site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
|
|
|
{ this.renderConversions() }
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2020-12-22 16:39:14 +03:00
|
|
|
|
2021-03-25 12:55:15 +03:00
|
|
|
export default withPinnedHeader(Historical, '#stats-container-top');
|