Client - application translation (wip)
This commit is contained in:
18
fittrackee_client/src/components/Common/NoActivities.jsx
Normal file
18
fittrackee_client/src/components/Common/NoActivities.jsx
Normal file
@ -0,0 +1,18 @@
|
||||
import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
export default class NoActivities extends React.PureComponent {
|
||||
render() {
|
||||
const { t } = this.props
|
||||
return (
|
||||
<div className="card text-center">
|
||||
<div className="card-body">
|
||||
{t('common:No workouts.')}{' '}
|
||||
<Link to={{ pathname: '/activities/add' }}>
|
||||
{t('dashboard:Upload one !')}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
@ -28,9 +28,9 @@ export default class StatsCharts extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const { displayedData } = this.state
|
||||
const { sports, stats } = this.props
|
||||
const { sports, stats, t } = this.props
|
||||
if (Object.keys(stats).length === 0) {
|
||||
return 'No workouts'
|
||||
return t('common:No workouts.')
|
||||
}
|
||||
return (
|
||||
<div className="chart-stats">
|
||||
@ -42,7 +42,7 @@ export default class StatsCharts extends React.PureComponent {
|
||||
checked={displayedData === 'distance'}
|
||||
onChange={e => this.handleRadioChange(e)}
|
||||
/>
|
||||
distance
|
||||
{t('statistics:distance')}
|
||||
</label>
|
||||
<label className="radioLabel col">
|
||||
<input
|
||||
@ -51,7 +51,7 @@ export default class StatsCharts extends React.PureComponent {
|
||||
checked={displayedData === 'duration'}
|
||||
onChange={e => this.handleRadioChange(e)}
|
||||
/>
|
||||
duration
|
||||
{t('statistics:duration')}
|
||||
</label>
|
||||
<label className="radioLabel col">
|
||||
<input
|
||||
@ -60,7 +60,7 @@ export default class StatsCharts extends React.PureComponent {
|
||||
checked={displayedData === 'activities'}
|
||||
onChange={e => this.handleRadioChange(e)}
|
||||
/>
|
||||
activities
|
||||
{t('statistics:activities')}
|
||||
</label>
|
||||
</div>
|
||||
<ResponsiveContainer height={300}>
|
||||
|
@ -37,10 +37,11 @@ class Statistics extends React.PureComponent {
|
||||
statistics,
|
||||
statsParams,
|
||||
displayEmpty,
|
||||
t,
|
||||
user,
|
||||
} = this.props
|
||||
if (!displayEmpty && Object.keys(statistics).length === 0) {
|
||||
return 'No workouts'
|
||||
return <span>{t('common:No workouts.')}</span>
|
||||
}
|
||||
const stats = formatStats(
|
||||
statistics,
|
||||
@ -49,7 +50,7 @@ class Statistics extends React.PureComponent {
|
||||
displayedSports,
|
||||
user.weekm
|
||||
)
|
||||
return <StatsChart sports={sports} stats={stats} />
|
||||
return <StatsChart sports={sports} stats={stats} t={t} />
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user