Translate HomePage, Stats

This commit is contained in:
Paul Bienkowski 2022-07-24 17:28:03 +02:00 committed by gluap
parent 7ce6b66b75
commit ea4d715f5d
No known key found for this signature in database

View file

@ -4,6 +4,7 @@ import {Message, Grid, Loader, Header, Item} from 'semantic-ui-react'
import {useObservable} from 'rxjs-hooks'
import {of, from} from 'rxjs'
import {map, switchMap} from 'rxjs/operators'
import {useTranslation} from 'react-i18next'
import api from 'api'
import {Stats, Page, Map} from 'components'
@ -24,14 +25,15 @@ function MostRecentTrack() {
[]
)
const {t} = useTranslation()
return (
<>
<Header as="h2">Most recent tracks</Header>
<Loader active={tracks === null} />
{tracks?.length === 0 ? (
<Message>
No public tracks yet. <Link to="/upload">Upload the first!</Link>
<Translate i18nKey="HomePage.noPublicTracks">
No public tracks yet. <Link to="/upload">Upload the first!</Link>
</Translate>
</Message>
) : tracks ? (
<Item.Group>
@ -54,7 +56,6 @@ export default function HomePage() {
</Grid.Column>
<Grid.Column width={8}>
<MostRecentTrack />
<RegionStats />
</Grid.Column>
</Grid.Row>
</Grid>