Skip to content

Commit ceffa15

Browse files
committed
fix: URLs /catalogue et /cartes
1 parent d9bf686 commit ceffa15

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

assets/config/navItems/navItems.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { MainNavigationProps } from "@codegouvfr/react-dsfr/MainNavigation";
22
import { TranslationFunction } from "i18nifty/typeUtils/TranslationFunction";
33

4+
import { catalogueUrl } from "@/env";
45
import { ComponentKey } from "../../i18n/types";
5-
import { routes } from "../../router/router";
6+
import { appRoot, routes } from "../../router/router";
67
import { assistanceNavItems } from "./assistanceNavItems";
78

89
// dans ce cas précise, getTranslation ne marche pas parce que les traductions sont pas encore chargées, on est donc obglié de passer la fonction t en paramètre
@@ -27,11 +28,11 @@ export const defaultNavItems = (t: TranslationFunction<"navItems", ComponentKey>
2728
},
2829
{
2930
text: t("catalog"),
30-
linkProps: { href: "./catalogue" },
31+
linkProps: { href: catalogueUrl ?? appRoot + "/catalogue" },
3132
},
3233
{
3334
text: t("maps"),
34-
linkProps: { href: "./cartes" },
35+
linkProps: { href: appRoot + "/cartes" },
3536
},
3637
{
3738
text: t("news"),

assets/env.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { appRoot } from "./router/router";
2+
13
const rootDataset = (document.getElementById("root") as HTMLDivElement)?.dataset;
24

35
export const espaceCoUrl = rootDataset?.["apiEspacecoUrl"] ?? null;
4-
export const catalogueUrl = rootDataset?.["catalogueUrl"] ?? "/catalogue";
6+
export const catalogueUrl = rootDataset?.["catalogueUrl"] ?? appRoot + "/catalogue";
57
export const configCommunityId = rootDataset?.["configCommunityId"] ?? null;
68
export const configTechnicalName = rootDataset?.["configTechnicalName"] ?? null;
79
export const annexesUrl = rootDataset?.["annexesUrl"] ?? "https://data.geopf.fr/annexes";

assets/pages/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useEffect } from "react";
1313

1414
import { catalogueUrl } from "@/env";
1515
import SymfonyRouting from "@/modules/Routing";
16-
import { routes, useRoute } from "@/router/router";
16+
import { appRoot, routes, useRoute } from "@/router/router";
1717
import { useAuthStore } from "@/stores/AuthStore";
1818
import homeImgUrl from "@/img/home/home.png";
1919
import Main from "@/components/Layout/Main";
@@ -90,7 +90,7 @@ const Home = () => {
9090
{
9191
iconId: "fr-icon-file-download-line",
9292
linkProps: {
93-
href: "./catalogue",
93+
href: catalogueUrl ?? appRoot + "/catalogue",
9494
},
9595
children: "J’accède au catalogue",
9696
priority: "secondary",

0 commit comments

Comments
 (0)