diff --git a/src/screens/FundCampaignPledge/PledgeModal.tsx b/src/screens/FundCampaignPledge/PledgeModal.tsx index 1edb50b9c3..e2f7fbcd70 100644 --- a/src/screens/FundCampaignPledge/PledgeModal.tsx +++ b/src/screens/FundCampaignPledge/PledgeModal.tsx @@ -97,11 +97,10 @@ const PledgeModal: React.FC = ({ const startDate = dayjs(pledgeStartDate).format('YYYY-MM-DD'); const endDate = dayjs(pledgeEndDate).format('YYYY-MM-DD'); - console.log('pledgeAmount', pledgeAmount); - const updatedFields: { [key: string]: number | string | string[] | undefined; } = {}; + // checks if there are changes to the pledge and adds them to the updatedFields object if (pledgeAmount !== pledge?.amount) { updatedFields.amount = pledgeAmount; } @@ -134,6 +133,7 @@ const PledgeModal: React.FC = ({ [formState, pledge], ); + // Function to create a new pledge const createPledgeHandler = useCallback( async (e: ChangeEvent): Promise => { try { @@ -190,6 +190,7 @@ const PledgeModal: React.FC = ({ } className="p-3" > + {/* A Multi-select dropdown enables admin to select more than one volunteer for participating in a pledge */} = ({ getOptionLabel={(member: InterfacePledgeVolunteer): string => `${member.firstName} ${member.lastName}` } + /*istanbul ignore next*/ onChange={(_, newVolunteers): void => { /*istanbul ignore next*/ setFormState({ @@ -216,6 +218,7 @@ const PledgeModal: React.FC = ({ /> + {/* Date Calendar Component to select start date of an event */} = ({ minDate={dayjs(pledgeStartDate)} maxDate={dayjs(endDate)} /> + {/* Date Calendar Component to select end Date of an event */} = ({ /> + {/* Dropdown to select the currency in which amount is to be pledged */} {t('currency')} @@ -265,6 +270,7 @@ const PledgeModal: React.FC = ({ value={pledgeCurrency} label={t('currency')} data-testid="currencySelect" + /*istanbul ignore next*/ onChange={(e) => { /*istanbul ignore next*/ setFormState({ @@ -280,6 +286,7 @@ const PledgeModal: React.FC = ({ ))} + {/* Input field to enter amount to be pledged */} = ({ /> - + {/* Button to submit the pledge form */}