From 76fa2b1fe9f404d6e546718416a0081f2d0062bc Mon Sep 17 00:00:00 2001 From: Alexander Petkov Date: Fri, 20 Oct 2023 15:37:28 +0300 Subject: [PATCH] donations: Use companyName when donation is made from corporate profile --- src/components/client/campaigns/DonationWishes.tsx | 6 +++++- .../client/campaigns/DonorsAndDonations.tsx | 4 +++- src/gql/campaigns.ts | 12 +++++++++++- src/gql/donationWish.d.ts | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/components/client/campaigns/DonationWishes.tsx b/src/components/client/campaigns/DonationWishes.tsx index 197634018..8f06f9c1d 100644 --- a/src/components/client/campaigns/DonationWishes.tsx +++ b/src/components/client/campaigns/DonationWishes.tsx @@ -171,7 +171,11 @@ export default function DonationWishes({ campaignId, pageSize = 5 }: Props) { fontSize: theme.typography.pxToRem(16), color: theme.palette.grey[800], }}> - {person ? person.firstName + ' ' + person.lastName : t('donations.anonymous')} + {person + ? person.company + ? person.company.companyName + : person.firstName + ' ' + person.lastName + : t('donations.anonymous')} {donation && ( diff --git a/src/components/client/campaigns/DonorsAndDonations.tsx b/src/components/client/campaigns/DonorsAndDonations.tsx index 8c4cfd58b..a85279146 100644 --- a/src/components/client/campaigns/DonorsAndDonations.tsx +++ b/src/components/client/campaigns/DonorsAndDonations.tsx @@ -93,7 +93,9 @@ export default function DonorsAndDonations({ {person - ? `${person.firstName} ${person.lastName}` + ? person.company + ? `${person.company.companyName}` + : `${person.firstName} ${person.lastName}` : t('campaigns:donations.anonymous')} diff --git a/src/gql/campaigns.ts b/src/gql/campaigns.ts index 67416b32a..a56036d23 100644 --- a/src/gql/campaigns.ts +++ b/src/gql/campaigns.ts @@ -87,7 +87,14 @@ export type CampaignResponse = BaseCampaignResponse & { category: CampaignTypeCategory slug: string } - summary: { reachedAmount: number; donors?: number; guaranteedAmount: number } + summary: { + reachedAmount: number + donors?: number + guaranteedAmount: number + withdrawnAmount: number + blockedAmount: number + currentAmount: number + } beneficiary: { id: UUID type: BeneficiaryType @@ -185,6 +192,9 @@ export type CampaignDonation = { person: { firstName: string lastName: string + company: { + companyName: string + } } } diff --git a/src/gql/donationWish.d.ts b/src/gql/donationWish.d.ts index 30443a1cb..0f8aa249d 100644 --- a/src/gql/donationWish.d.ts +++ b/src/gql/donationWish.d.ts @@ -11,7 +11,7 @@ export type DonationWishResponse = { campaignId: UUID donationId?: UUID personId?: UUID - person?: { firstName: string; lastName: string } + person?: { firstName: string; lastName: string; company: { companyName: string } } donation?: { amount: number; currency: string } createdAt: DateTime }