Skip to content

Commit

Permalink
fix: for non-endaoment project modal
Browse files Browse the repository at this point in the history
  • Loading branch information
HrithikSampson committed Sep 26, 2024
1 parent 969417a commit 593d3d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/views/donate/DonateIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const DonateIndex: FC = () => {
activeStartedRound,
startTimer,
setDonateModalByPriority,
setIsModalPriorityChecked,
} = useDonateData();
const { renewExpirationDate, retrieveDraftDonation } =
useQRCodeDonation(project);
Expand Down Expand Up @@ -114,6 +115,7 @@ const DonateIndex: FC = () => {
return;
}
}
setIsModalPriorityChecked(DonateModalPriorityValues.OFACSanctionListModal);

Check failure on line 118 in src/components/views/donate/DonateIndex.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `DonateModalPriorityValues.OFACSanctionListModal` with `⏎↹↹↹DonateModalPriorityValues.OFACSanctionListModal,⏎↹↹`
};

useEffect(() => {
Expand All @@ -129,6 +131,7 @@ const DonateIndex: FC = () => {
DonateModalPriorityValues.DonationByProjectOwner,
);
}
setIsModalPriorityChecked(DonateModalPriorityValues.DonationByProjectOwner);

Check failure on line 134 in src/components/views/donate/DonateIndex.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `DonateModalPriorityValues.DonationByProjectOwner` with `⏎↹↹↹DonateModalPriorityValues.DonationByProjectOwner,⏎↹↹`
}, [userData?.id, project.adminUser]);

useEffect(() => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/donate/OneTime/OneTimeDonationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const CryptoDonation: FC<{
selectedOneTimeToken,
shouldRenderModal,
setDonateModalByPriority,
setIsModalPriorityChecked,
} = useDonateData();
const dispatch = useAppDispatch();

Expand Down Expand Up @@ -336,6 +337,7 @@ const CryptoDonation: FC<{
DonateModalPriorityValues.ShowNetworkModal,
);
}
setIsModalPriorityChecked(DonateModalPriorityValues.ShowNetworkModal);
}, [showChangeNetworkModal, acceptedChains]);

// We need givethDonationAmount here because we need to calculate the donation share
Expand Down
5 changes: 4 additions & 1 deletion src/context/donate.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ interface IDonateContext {
setSelectedRecurringToken: Dispatch<
SetStateAction<ISelectTokenWithBalance | undefined>
>;
setIsModalPriorityChecked: (modal: DonateModalPriorityValues) => void;
shouldRenderModal: (modalRender: DonateModalPriorityValues) => boolean;
fetchProject: () => Promise<void>;
draftDonationData?: IDraftDonation;
Expand Down Expand Up @@ -85,9 +86,10 @@ const DonateContext = createContext<IDonateContext>({
tokenStreams: {},
fetchProject: async () => {},
setDonateModalByPriority: (

Check failure on line 88 in src/context/donate.context.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `⏎↹↹changeModal:·DonateModalPriorityValues,⏎↹` with `changeModal:·DonateModalPriorityValues`
changeCurrentModal: DonateModalPriorityValues,
changeModal: DonateModalPriorityValues,
) => {},
shouldRenderModal: (modalRender: DonateModalPriorityValues) => false,
setIsModalPriorityChecked: (modal: DonateModalPriorityValues) => {},
draftDonationData: {} as IDraftDonation,
fetchDraftDonation: async () => {},
qrDonationStatus: 'waiting',
Expand Down Expand Up @@ -242,6 +244,7 @@ export const DonateProvider: FC<IProviderProps> = ({ children, project }) => {
setSelectedOneTimeToken,
shouldRenderModal,
setSelectedRecurringToken,
setIsModalPriorityChecked,
tokenStreams,
fetchProject,
draftDonationData: draftDonation as IDraftDonation,
Expand Down

0 comments on commit 593d3d4

Please sign in to comment.