Replace /stats by /statistiques
parent
96a6e79405
commit
ab5bd85ec3
|
@ -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é}
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue