From 28d7161dd934f5b422c7530ae2f2f6084ab08817 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 7 May 2021 12:09:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Supprime=20les=20slash=20de=20fi?= =?UTF-8?q?n=20d'URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1446 Co-authored-by: Maël Thomas --- mon-entreprise/source/App.tsx | 11 ++++++++++- publicodes/site/components/App.tsx | 13 ++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mon-entreprise/source/App.tsx b/mon-entreprise/source/App.tsx index 22bfaba66..b0a4a42b2 100644 --- a/mon-entreprise/source/App.tsx +++ b/mon-entreprise/source/App.tsx @@ -14,7 +14,7 @@ import { useContext, useMemo } from 'react' import { Helmet } from 'react-helmet' import { useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' -import { Route, Switch } from 'react-router-dom' +import { Redirect, Route, Switch } from 'react-router-dom' import { configSituationSelector, situationSelector, @@ -85,6 +85,15 @@ const Router = () => { + {/* Removes trailing slashes */} + ( + + )} + /> diff --git a/publicodes/site/components/App.tsx b/publicodes/site/components/App.tsx index d97139643..3941d4500 100644 --- a/publicodes/site/components/App.tsx +++ b/publicodes/site/components/App.tsx @@ -1,7 +1,7 @@ import 'Components/ui/index.css' import { useEffect } from 'react' import { hot } from 'react-hot-loader' -import { Route, Switch } from 'react-router-dom' +import { Redirect, Route, Switch } from 'react-router-dom' import Communauté from '../pages/Communauté' import Documentation from '../pages/Documentation' import Landing from '../pages/Landing' @@ -34,6 +34,17 @@ const RouterSwitch = () => { > + {/* Removes trailing slashes */} + ( + + )} + />