@@ -101,7 +104,7 @@ export default function StepConsentements() {
<>M'inscris au séjour de cohésion >
) : (
<>
- M'inscris au séjour de cohésion
sous réserve de places disponibles{" "}
+ M'inscris au séjour de cohésion
sous réserve de places disponibles{" "}
>
)}
et m'engage à en respecter le{" "}
diff --git a/app/src/scenes/phase1/scenes/affected/components/Problem.jsx b/app/src/scenes/phase1/scenes/affected/components/Problem.jsx
index 91994d8b95..cffcd74843 100644
--- a/app/src/scenes/phase1/scenes/affected/components/Problem.jsx
+++ b/app/src/scenes/phase1/scenes/affected/components/Problem.jsx
@@ -1,9 +1,9 @@
import React from "react";
-import { getCohortPeriod } from "snu-lib";
import { RiErrorWarningLine } from "react-icons/ri";
-import { getCohort } from "@/utils/cohorts";
+import useCohort from "@/services/useCohort";
-export default function Problem({ cohort }) {
+export default function Problem() {
+ const { cohortDateString } = useCohort();
return (
@@ -14,12 +14,12 @@ export default function Problem({ cohort }) {
Mon séjour de cohésion
- {getCohortPeriod(getCohort(cohort))}
+ {cohortDateString}
-
Séjour {getCohortPeriod(getCohort(cohort))}
+ Séjour {cohortDateString}
diff --git a/app/src/scenes/phase1/scenes/affected/components/modals/PDRModal.jsx b/app/src/scenes/phase1/scenes/affected/components/modals/PDRModal.jsx
index c840829367..736e11a536 100644
--- a/app/src/scenes/phase1/scenes/affected/components/modals/PDRModal.jsx
+++ b/app/src/scenes/phase1/scenes/affected/components/modals/PDRModal.jsx
@@ -3,18 +3,19 @@ import Modal from "@/components/ui/modals/Modal";
import { setYoung } from "@/redux/auth/actions";
import { capture } from "@/sentry";
import API from "@/services/api";
-import { getCohort } from "@/utils/cohorts";
+import useAuth from "@/services/useAuth";
+import useCohort from "@/services/useCohort";
import React, { useState } from "react";
-import { useDispatch, useSelector } from "react-redux";
+import { useDispatch } from "react-redux";
import { toastr } from "react-redux-toastr";
import MeetingPointChooser from "../MeetingPointChooser";
import MeetingPointGoAlone from "../MeetingPointGoAlone";
import { getDepartureDate, getReturnDate } from "snu-lib";
import MeetingPointConfirmationModal from "../MeetingPointConfirmationModal";
-export default function PDRModal({ open, setOpen, meetingPoints, center, session, pdrChoiceExpired }) {
- const young = useSelector((state) => state.Auth.young);
- const cohort = getCohort(young.cohort);
+export default function PDRModal({ open, setOpen, meetingPoints, center, session }) {
+ const { young } = useAuth();
+ const { cohort, pdrChoiceExpired } = useCohort();
const dispatch = useDispatch();
const [modalMeetingPoint, setModalMeetingPoint] = useState({ isOpen: false, meetingPoint: null });
const [loading, setLoading] = useState(false);
diff --git a/app/src/scenes/phase1/scenes/affected/components/step/StepPDR.jsx b/app/src/scenes/phase1/scenes/affected/components/step/StepPDR.jsx
index b65ab841da..44469b1905 100644
--- a/app/src/scenes/phase1/scenes/affected/components/step/StepPDR.jsx
+++ b/app/src/scenes/phase1/scenes/affected/components/step/StepPDR.jsx
@@ -5,7 +5,7 @@ import utc from "dayjs/plugin/utc";
dayjs.extend(utc);
import { capture } from "../../../../../../sentry";
import api from "../../../../../../services/api";
-import { getMeetingHour, getReturnHour, isCle } from "snu-lib";
+import { getMeetingHour, getReturnHour } from "snu-lib";
import { ALONE_ARRIVAL_HOUR, ALONE_DEPARTURE_HOUR } from "../../utils/steps.utils";
import { StepCard } from "../StepCard";
import PDRModal from "../modals/PDRModal";
@@ -14,7 +14,7 @@ import useCohort from "@/services/useCohort";
export default function StepPDR({ data: { center, session, meetingPoint, departureDate, returnDate } }) {
const index = 1;
- const { young } = useAuth();
+ const { young, isCLE } = useAuth();
const { pdrChoiceExpired, pdrChoiceLimitDate } = useCohort();
const [open, setOpen] = useState(false);
const [meetingPoints, setMeetingPoints] = useState([]);
@@ -46,7 +46,7 @@ export default function StepPDR({ data: { center, session, meetingPoint, departu
setOpen(!open);
}
- if (isCle(young)) {
+ if (isCLE) {
return (
Confirmation du point de rendez-vous : vous n'avez rien à faire
@@ -73,7 +73,7 @@ export default function StepPDR({ data: { center, session, meetingPoint, departu