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