Skip to content

Commit

Permalink
update account info update link
Browse files Browse the repository at this point in the history
  • Loading branch information
celineung committed Oct 30, 2024
1 parent 49b52ef commit 09f6ff9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions front/src/app/components/layout/LayoutHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useIsDark } from "@codegouvfr/react-dsfr/useIsDark";
import React from "react";
import { ButtonWithSubMenu, MaintenanceCallout } from "react-design-system";
import { useDispatch } from "react-redux";
import { domElementIds } from "shared";
import { AbsoluteUrl, domElementIds } from "shared";
import { useAppSelector } from "src/app/hooks/reduxHooks";
import { useFeatureFlags } from "src/app/hooks/useFeatureFlags";
import { routes, useRoute } from "src/app/routes/routes";
Expand All @@ -14,6 +14,7 @@ import { authSelectors } from "src/core-logic/domain/auth/auth.selectors";
import { authSlice } from "src/core-logic/domain/auth/auth.slice";
import { makeStyles } from "tss-react/dsfr";

import { featureFlagSelectors } from "src/core-logic/domain/featureFlags/featureFlags.selector";
import immersionFacileDarkLogo from "/assets/img/logo-if-dark.svg";
import immersionFacileLightLogo from "/assets/img/logo-if.svg";

Expand Down Expand Up @@ -49,6 +50,17 @@ export const LayoutHeader = () => {
);
const isAdminConnected = useAppSelector(authSelectors.isAdminConnected);
const isPeConnected = useAppSelector(authSelectors.isPeConnected);
const { enableProConnect } = useAppSelector(
featureFlagSelectors.featureFlagState,
);
const getLinkToUpdateAccountInfo = (): AbsoluteUrl => {
if (ENV.envType !== "production")
return "https://recette.connect.inclusion.beta.gouv.fr/accounts/my-account"; // en attendant d'avoir l'url pour la recette de ProConnect
if (!enableProConnect.isActive)
return "https://connect.inclusion.beta.gouv.fr/accounts/my-account";
return "https://app.moncomptepro.beta.gouv.fr/personal-information";
};

const tools: HeaderProps["quickAccessItems"] = [
{
text: "Remplir la demande de convention",
Expand Down Expand Up @@ -90,9 +102,7 @@ export const LayoutHeader = () => {
text: "Modifier mes informations",
isActive: false,
linkProps: {
href: `https://${
ENV.envType === "production" ? "" : "recette."
}connect.inclusion.beta.gouv.fr/accounts/my-account`,
href: getLinkToUpdateAccountInfo(),
target: "_blank",
},
},
Expand Down

0 comments on commit 09f6ff9

Please sign in to comment.