FitTrackee/fittrackee_client/src/components/Dashboard/Statistics.jsx

30 lines
715 B
React
Raw Normal View History

2019-01-03 11:16:46 +01:00
import { endOfMonth, startOfMonth } from 'date-fns'
2018-05-09 10:25:08 +02:00
import React from 'react'
2019-01-03 12:53:47 +01:00
import Stats from '../Common/Stats'
2018-05-09 10:25:08 +02:00
2019-01-03 11:16:46 +01:00
export default class Statistics extends React.Component {
constructor(props, context) {
super(props, context)
const date = new Date()
this.state = {
start: startOfMonth(date),
end: endOfMonth(date),
2019-01-03 11:16:46 +01:00
duration: 'week',
type: 'by_time',
}
}
render() {
2019-09-16 10:26:02 +02:00
const { t } = this.props
return (
<div className="card workout-card">
2019-09-16 10:26:02 +02:00
<div className="card-header">{t('dashboard:This month')}</div>
2018-06-07 12:42:30 +02:00
<div className="card-body">
2019-09-16 10:26:02 +02:00
<Stats displayEmpty={false} statsParams={this.state} t={t} />
</div>
2018-05-09 10:25:08 +02:00
</div>
)
}
2018-05-09 10:25:08 +02:00
}