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'
|
2020-07-14 16:52:26 +03:00
|
|
|
import Pages from './stats/pages'
|
|
|
|
import Countries from './stats/countries'
|
|
|
|
import Devices from './stats/devices'
|
|
|
|
import Conversions from './stats/conversions'
|
|
|
|
|
|
|
|
export default class Stats extends React.Component {
|
|
|
|
renderConversions() {
|
|
|
|
if (this.props.site.hasGoals) {
|
|
|
|
return (
|
|
|
|
<div className="w-full block md:flex items-start justify-between mt-6">
|
|
|
|
<Conversions site={this.props.site} query={this.props.query} title="Goal Conversions (last 30 min)" />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="mb-12">
|
|
|
|
<div className="w-full sm:flex justify-between items-center">
|
|
|
|
<div className="w-full flex items-center">
|
2020-08-13 13:45:18 +03:00
|
|
|
<SiteSwitcher site={this.props.site} loggedIn={this.props.loggedIn} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
|
|
|
<Datepicker site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
|
|
|
<Filters query={this.props.query} history={this.props.history} />
|
|
|
|
<VisitorGraph site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
<div className="w-full block md:flex items-start justify-between">
|
2020-08-17 15:13:30 +03:00
|
|
|
<Sources site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
2020-07-14 16:52:26 +03:00
|
|
|
<Pages site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
</div>
|
|
|
|
<div className="w-full block md:flex items-start justify-between">
|
|
|
|
<Countries site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
<Devices site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{ this.renderConversions() }
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|