feat: improve simulator bloc on stat page

pull/2908/head
Johan Girod 2024-03-01 19:24:30 +01:00
parent f7e186fd94
commit e1e5ccfe1e
3 changed files with 27 additions and 28 deletions

View File

@ -3,13 +3,16 @@ import { Trans } from 'react-i18next'
import { useSearchParams } from 'react-router-dom'
import { toAtString } from '@/components/ATInternetTracking'
import Privacy from '@/components/layout/Footer/Privacy'
import { FromTop } from '@/components/ui/animate'
import { useScrollToHash } from '@/components/utils/markdown'
import { Emoji } from '@/design-system/emoji'
import { Grid, Spacing } from '@/design-system/layout'
import { Switch } from '@/design-system/switch'
import { Strong } from '@/design-system/typography'
import { H2, H3 } from '@/design-system/typography/heading'
import { H1, H2, H3 } from '@/design-system/typography/heading'
import { Li, Ul } from '@/design-system/typography/list'
import { Body } from '@/design-system/typography/paragraphs'
import { Body, Intro } from '@/design-system/typography/paragraphs'
import useSimulatorsData, { SimulatorData } from '@/hooks/useSimulatorsData'
import PagesChart from '@/pages/statistiques/_components/PagesCharts'
@ -42,23 +45,36 @@ export default function StatPage({ stats }: StatsDetailProps) {
return (
<>
<Spacing sm />
<Grid container>
<Spacing md />
<Grid container spacing={4} style={{ alignItems: 'flex-end' }}>
<Grid item xs={12} md={7}>
<Spacing xl />
<H1>
Statistiques <Emoji emoji="📊" />
</H1>
<Intro>
Découvrez nos statistiques d'utilisation mises à jour
quotidiennement.
</Intro>
<Body>
Les données recueillies sont anonymisées.{' '}
<Privacy label="En savoir plus." />
</Body>
<SimulateursChoice
onChange={setFilter}
value={filter}
key={JSON.stringify(filter)}
/>
</Grid>
<Grid item md={1} />
<Grid item xs={12} md={4}>
<Grid item xs={12} md={5}>
{filter && (
<>
<Grid container columns={4}>
<Grid container columns={4}>
<FromTop key={JSON.stringify(filter)}>
<SelectedSimulator filter={filter} />
</Grid>
</>
</FromTop>
</Grid>
)}
</Grid>
</Grid>

View File

@ -15,7 +15,7 @@ export function SelectedSimulator(props: { filter: Filter | '' }) {
return null
}
return <SimulateurCard small {...simulateur} />
return <SimulateurCard {...simulateur} />
}
export function SimulateursChoice(props: {
onChange: (ch: Filter | '') => void

View File

@ -2,12 +2,9 @@ import { lazy, Suspense } from 'react'
import { useTranslation } from 'react-i18next'
import { TrackPage } from '@/components/ATInternetTracking'
import Privacy from '@/components/layout/Footer/Privacy'
import MoreInfosOnUs from '@/components/MoreInfosOnUs'
import PageHeader from '@/components/PageHeader'
import Meta from '@/components/utils/Meta'
import { ScrollToTop } from '@/components/utils/Scroll'
import { Emoji } from '@/design-system/emoji'
import { Intro } from '@/design-system/typography/paragraphs'
const Stats = lazy(() => import('./Stats'))
@ -26,20 +23,6 @@ export default function StatsPage() {
)}
/>
<ScrollToTop />
<PageHeader
titre={
<>
Statistiques <Emoji emoji="📊" />
</>
}
>
<Intro>
Découvrez nos statistiques d'utilisation mises à jour quotidiennement.
<br />
Les données recueillies sont anonymisées.{' '}
<Privacy label="En savoir plus." />
</Intro>
</PageHeader>
<Suspense fallback={<Intro>Chargement des statistiques...</Intro>}>
<Stats />