Replace /stats by /statistiques

pull/2529/head
Jérémy Rialland 2023-02-27 16:16:35 +01:00 committed by Johan Girod
parent 96a6e79405
commit ab5bd85ec3
3 changed files with 18 additions and 4 deletions

View File

@ -3,7 +3,7 @@ import { FallbackRender } from '@sentry/react/types/errorboundary'
import rules from 'modele-social'
import { ComponentProps, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { Route, Routes } from 'react-router-dom'
import { Navigate, Route, Routes, redirect } from 'react-router-dom'
import styled, { css } from 'styled-components'
import Route404 from '@/components/Route404'
@ -82,11 +82,24 @@ const Router = () => {
return (
<Routes>
<Route index element={<Landing />} />
<Redirections />
<Route path="/iframes/*" element={<Iframes />} />
<Route path="*" element={<App />} />
</Routes>
)
}
const Redirections = () => {
const { relativeSitePaths } = useSitePaths()
return (
<>
<Route
path="/stats"
element={<Navigate to={relativeSitePaths.stats} replace />}
/>
</>
)
}
const CatchOffline = ({ error }: ComponentProps<FallbackRender>) => {
if (error.message.includes('dynamically imported module')) {
@ -156,7 +169,7 @@ const App = () => {
path={relativeSitePaths.nouveautés + '/*'}
element={<Nouveautés />}
/>
<Route path={relativeSitePaths.stats} element={<Stats />} />
<Route path={relativeSitePaths.stats} e lement={<Stats />} />
<Route path={relativeSitePaths.budget} element={<Budget />} />
<Route
path={relativeSitePaths.accessibilité}

View File

@ -1,6 +1,6 @@
import Engine from 'publicodes'
import { useTranslation } from 'react-i18next'
import { Route, Routes, redirect, useNavigate } from 'react-router-dom'
import { Route, Routes, useNavigate } from 'react-router-dom'
import { DottedName } from '@/../../modele-social'
import PeriodSwitch from '@/components/PeriodSwitch'

View File

@ -92,7 +92,7 @@ const rawSitePathsFr = {
'exonération-covid': 'exonération-covid',
},
nouveautés: 'nouveautés',
stats: 'stats',
stats: 'statistiques',
accessibilité: 'accessibilité',
budget: 'budget',
développeur: {
@ -181,6 +181,7 @@ const rawSitePathsEn = {
'exonération-covid': 'exoneration-covid',
},
nouveautés: 'news',
stats: 'statistics',
accessibilité: 'accessibility',
développeur: {
...rawSitePathsFr.développeur,