Skip to content

Commit

Permalink
Add personal note to donation record view if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
patnorris authored and patnorris committed Feb 25, 2024
1 parent 3d8f822 commit c017e78
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ type DonationTracker =
getTxidstext: () -> (TxidstextResult);
getUTXOS: () -> (GetUtxosResponseResult);
initRecipients: () -> (InitRecipientsResult);
isControllerLogicOk: () -> (AuthRecordResult);
listRecipients: (RecipientFilter) -> (RecipientsResult) query;
makeDonation: (DonationRecord) -> (DtiResult);
submitSignUpForm: (SignUpFormInput) -> (text);
Expand Down Expand Up @@ -190,7 +191,7 @@ type Donation =
allocation: DonationCategories;
donor: DonorType;
dti: DTI;
hasBeenDistributed: bool;
hasBeenDistributed: opt bool;
paymentTransactionId: PaymentTransactionId;
paymentType: PaymentType;
personalNote: opt text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface Donation {
'dti' : DTI,
'rewardsHaveBeenClaimed' : boolean,
'paymentTransactionId' : PaymentTransactionId,
'hasBeenDistributed' : boolean,
'hasBeenDistributed' : [] | [boolean],
'totalAmount' : Satoshi,
'timestamp' : bigint,
'paymentType' : PaymentType,
Expand Down Expand Up @@ -87,6 +87,7 @@ export interface DonationTracker {
'getTxidstext' : ActorMethod<[], TxidstextResult>,
'getUTXOS' : ActorMethod<[], GetUtxosResponseResult>,
'initRecipients' : ActorMethod<[], InitRecipientsResult>,
'isControllerLogicOk' : ActorMethod<[], AuthRecordResult>,
'listRecipients' : ActorMethod<[RecipientFilter], RecipientsResult>,
'makeDonation' : ActorMethod<[DonationRecord], DtiResult>,
'submitSignUpForm' : ActorMethod<[SignUpFormInput], string>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const idlFactory = ({ IDL }) => {
'dti' : DTI,
'rewardsHaveBeenClaimed' : IDL.Bool,
'paymentTransactionId' : PaymentTransactionId,
'hasBeenDistributed' : IDL.Bool,
'hasBeenDistributed' : IDL.Opt(IDL.Bool),
'totalAmount' : Satoshi,
'timestamp' : IDL.Nat64,
'paymentType' : PaymentType,
Expand Down Expand Up @@ -220,6 +220,7 @@ export const idlFactory = ({ IDL }) => {
'getTxidstext' : IDL.Func([], [TxidstextResult], []),
'getUTXOS' : IDL.Func([], [GetUtxosResponseResult], []),
'initRecipients' : IDL.Func([], [InitRecipientsResult], []),
'isControllerLogicOk' : IDL.Func([], [AuthRecordResult], []),
'listRecipients' : IDL.Func(
[RecipientFilter],
[RecipientsResult],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</script>

<div class="text-gray-900 dark:text-gray-200">
<div>
<div class="pb-6 space-y-2">
<p>Total Amount: {donation.totalAmount} {Object.keys(donation.paymentType)[0] === "BTC" ? "Satoshi" : ""}</p>
<p>Payment Type: {Object.keys(donation.paymentType)[0]}</p>
{#if Object.keys(donation.paymentType)[0] === "BTC"}
Expand Down Expand Up @@ -44,6 +44,11 @@
{#each Object.entries(donation.allocation) as [category, categoryValues], index}
<p>{categoryNameTranslator[category]}: {categoryValues}</p>
{/each}
{#if donation.personalNote[0]}
<span class="inline-block break-all">
<p>Personal Note: {donation.personalNote[0]}</p>
</span>
{/if}
</div>
<RecipientProfile recipientId={donation.recipientId} embedded={false} />
</div>
Expand Down

0 comments on commit c017e78

Please sign in to comment.