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 31, 2024
1 parent 06dacca commit 46df08e
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 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,20 @@ 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") {
if (enableProConnect.isActive)
return "https://app.moncomptepro.beta.gouv.fr/personal-information";
return "https://connect.inclusion.beta.gouv.fr/accounts/my-account";
}
if (enableProConnect.isActive)
return "https://app-preprod.moncomptepro.beta.gouv.fr/personal-information";
return "https://recette.connect.inclusion.beta.gouv.fr/accounts/my-account";
};

const tools: HeaderProps["quickAccessItems"] = [
{
text: "Remplir la demande de convention",
Expand Down Expand Up @@ -90,9 +105,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 Expand Up @@ -301,7 +314,7 @@ export const LayoutHeader = () => {
message={
enableMaintenance.value.message !== ""
? enableMaintenance.value.message
: "⚠️ Le site est actuellement en maintenance. Il est possible que le service soit dégradé. Nous vous prions de nous excuser pour la gêne occasionnée."
: "! Le site est actuellement en maintenance. Il est possible que le service soit dégradé. Nous vous prions de nous excuser pour la gêne occasionnée."
}
level={enableMaintenance.value.severity}
/>
Expand Down

0 comments on commit 46df08e

Please sign in to comment.