diff --git a/src/components/reservation/ReservationModalBody.tsx b/src/components/reservation/ReservationModalBody.tsx index 0d71f4cb2e..081578d1ff 100644 --- a/src/components/reservation/ReservationModalBody.tsx +++ b/src/components/reservation/ReservationModalBody.tsx @@ -65,6 +65,7 @@ import configuration, { getConf } from "../../core/configuration"; import useReservableFromAnotherLibrary from "../../core/utils/useReservableFromAnotherLibrary"; import { usePatronData } from "../../core/utils/helpers/usePatronData"; import { Periods } from "./types"; +import { RequestStatus } from "../../core/utils/types/request"; type ReservationModalProps = { selectedManifestations: Manifestation[]; @@ -331,6 +332,7 @@ export const ReservationModalBody = ({ : selectedInterest } setSelectedInterest={setSelectedInterest} + reservationStatus={reservationStatus} /> )} diff --git a/src/components/reservation/UserListItems.tsx b/src/components/reservation/UserListItems.tsx index 733e03393e..ef78c7536e 100644 --- a/src/components/reservation/UserListItems.tsx +++ b/src/components/reservation/UserListItems.tsx @@ -23,6 +23,7 @@ import { import PickupModal from "./forms/PickupModal"; import NoInterestAfterModal from "./forms/NoInterestAfterModal"; import { Periods } from "./types"; +import { RequestStatus } from "../../core/utils/types/request"; export interface UserListItemsProps { patron: PatronV5; @@ -32,6 +33,7 @@ export interface UserListItemsProps { selectedInterest: number | null; setSelectedInterest: (value: number) => void; whitelistBranches: AgencyBranch[]; + reservationStatus: RequestStatus; } const UserListItems: FC = ({ @@ -42,7 +44,8 @@ const UserListItems: FC = ({ selectBranchHandler, selectedInterest, setSelectedInterest, - whitelistBranches + whitelistBranches, + reservationStatus }) => { const t = useText(); const config = useConfig(); @@ -83,6 +86,7 @@ const UserListItems: FC = ({ selectedInterest ?? interestPeriods.defaultInterestPeriod.value } setSelectedInterest={setSelectedInterest} + reservationStatus={reservationStatus} /> )} @@ -99,6 +103,7 @@ const UserListItems: FC = ({ branches={whitelistBranches} defaultBranch={selectedBranch ?? preferredPickupBranch} selectBranchHandler={selectBranchHandler} + reservationStatus={reservationStatus} /> )} diff --git a/src/components/reservation/forms/ModalReservationFormSelect.tsx b/src/components/reservation/forms/ModalReservationFormSelect.tsx index 6c8d2e5413..0addaa26ea 100644 --- a/src/components/reservation/forms/ModalReservationFormSelect.tsx +++ b/src/components/reservation/forms/ModalReservationFormSelect.tsx @@ -31,7 +31,7 @@ export interface ModalReservationFormSelectProps< saveCallback?: ( value: TSaveValue ) => void; - reservationStatus?: RequestStatus; + reservationStatus: RequestStatus; setReservationStatus?: (status: RequestStatus) => void; } @@ -129,6 +129,7 @@ const ModalReservationFormSelect = ({ title={header.title} description={header.description} onSubmit={onSubmit} + disabledButton={reservationStatus === "pending"} buttonLabel={ reservationStatus === "pending" ? t("loadingText") : undefined } diff --git a/src/components/reservation/forms/NoInterestAfterModal.tsx b/src/components/reservation/forms/NoInterestAfterModal.tsx index 0a00f113df..a3c6180421 100644 --- a/src/components/reservation/forms/NoInterestAfterModal.tsx +++ b/src/components/reservation/forms/NoInterestAfterModal.tsx @@ -10,7 +10,7 @@ interface NoInterestAfterModalProps { selectedInterest: number; setSelectedInterest: (value: number) => void; saveCallback?: (value: TValue) => void; - reservationStatus?: RequestStatus; + reservationStatus: RequestStatus; setReservationStatus?: (status: RequestStatus) => void; } diff --git a/src/components/reservation/forms/PickupModal.tsx b/src/components/reservation/forms/PickupModal.tsx index d2211ef098..3525cb5c8c 100644 --- a/src/components/reservation/forms/PickupModal.tsx +++ b/src/components/reservation/forms/PickupModal.tsx @@ -10,7 +10,7 @@ export interface PickupModalProps { defaultBranch: string; selectBranchHandler: (value: string) => void; saveCallback?: (value: TValue) => void; - reservationStatus?: RequestStatus; + reservationStatus: RequestStatus; setReservationStatus?: (status: RequestStatus) => void; }