adding a sport filter for stats graphs - #13

This commit is contained in:
Sam
2019-01-04 13:42:52 +01:00
parent 3d4ad8da81
commit a13d00d5d9
4 changed files with 79 additions and 16 deletions

View File

@ -25,14 +25,17 @@ class Statistics extends React.PureComponent {
}
render() {
const { sports, statistics, statsParams } = this.props
const stats = formatStats(statistics, sports, statsParams)
const { displayedSports, sports, statistics, statsParams } = this.props
const stats = formatStats(statistics, sports, statsParams, displayedSports)
return (
<>
{Object.keys(statistics).length === 0 ? (
'No workouts'
) : (
<StatsChart sports={sports} stats={stats} />
<StatsChart
sports={sports}
stats={stats}
/>
)}
</>
)