Skip to content

Commit

Permalink
feat: prevent GiftForm display for planet-cash donations
Browse files Browse the repository at this point in the history
mohitb35 committed Nov 13, 2024
1 parent 66552ec commit 09ccd93
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -409,7 +409,12 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
utmSource = context.query.utm_source;

// Set gift details if there is s (support link) in the query params
if (projectDetails?.category !== "membership" && context.query.s) {
if (
projectDetails !== null &&
projectDetails?.category !== "membership" &&
projectDetails.purpose !== "planet-cash" &&
context.query.s
) {
try {
const requestParams = {
url: `/app/profiles/${context.query.s}`,
7 changes: 6 additions & 1 deletion src/Donations/Components/DonationsForm.tsx
Original file line number Diff line number Diff line change
@@ -130,9 +130,14 @@ function DonationsForm(): ReactElement {
!(isGift && giftDetails.recipientName === "") &&
!(onBehalf && onBehalfDonor.firstName === "");

const canSendDirectGift = projectDetails?.category !== "membership";
const canSendDirectGift =
projectDetails !== null &&
projectDetails.category !== "membership" &&
projectDetails.purpose !== "planet-cash";
const hasDirectGift = giftDetails.type === "direct";
const canSendInvitationGift =
projectDetails !== null &&
projectDetails.purpose !== "planet-cash" &&
!hasDirectGift &&
((projectDetails?.category !== "membership" && frequency === "once") ||
(projectDetails?.category === "membership" && frequency !== "once"));

0 comments on commit 09ccd93

Please sign in to comment.