From eccbea537de8bc62875be18262275c2db2c089ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Thu, 7 Jul 2022 11:04:28 +0200 Subject: [PATCH] Replace regex by index to get relative path --- .../Simulateurs/EconomieCollaborative/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/site/source/pages/Simulateurs/EconomieCollaborative/index.tsx b/site/source/pages/Simulateurs/EconomieCollaborative/index.tsx index 9e3a668e0..b20d21817 100644 --- a/site/source/pages/Simulateurs/EconomieCollaborative/index.tsx +++ b/site/source/pages/Simulateurs/EconomieCollaborative/index.tsx @@ -12,14 +12,12 @@ import { StoreProvider } from './StoreContext' import VotreSituation from './VotreSituation' export default function ÉconomieCollaborative() { - const sitePaths = useContext(SitePathsContext) + const { économieCollaborative } = useContext(SitePathsContext).simulateurs const iframePath = useSimulatorsData()['économie-collaborative'].iframePath ?? '' const indexPath = useIsEmbedded() ? '/iframes/' + iframePath - : sitePaths.simulateurs.économieCollaborative.index - - const relative = (path: string) => path.replace(/.*\//, '/') + : économieCollaborative.index return ( @@ -35,8 +33,10 @@ export default function ÉconomieCollaborative() { } /> } />