mirror of https://github.com/status-im/fathom.git
pass period to table component
This commit is contained in:
parent
8137f10fbc
commit
399c486209
|
@ -25,7 +25,6 @@ class CountWidget extends Component {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(newProps) {
|
||||
console.log(newProps);
|
||||
if(this.props.period != newProps.period) {
|
||||
this.fetchData(newProps.period)
|
||||
}
|
||||
|
@ -36,6 +35,7 @@ class CountWidget extends Component {
|
|||
let before, after;
|
||||
let afterDate = new Date();
|
||||
afterDate.setHours(0, 0, 0, 0);
|
||||
|
||||
switch(period) {
|
||||
case "week":
|
||||
afterDate.setDate(afterDate.getDate() - (afterDate.getDay() + 6) % 7);
|
||||
|
|
|
@ -52,8 +52,8 @@ class Dashboard extends Component {
|
|||
<CountWidget title="Bounce rate" endpoint="bounce-rate" format="percentage" period={state.period} />
|
||||
</div>
|
||||
|
||||
<Table endpoint="pageviews" headers={["Top pages", "Views", "Uniques"]} />
|
||||
<Table endpoint="referrers" headers={["Top referrers", "Views", "Uniques"]} />
|
||||
<Table endpoint="pageviews" headers={["Top pages", "Views", "Uniques"]} period={state.period} />
|
||||
<Table endpoint="referrers" headers={["Top referrers", "Views", "Uniques"]} period={state.period} />
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Reference in New Issue