From 1b05c6f356236d219d4d7153088f7e14aee37b4a Mon Sep 17 00:00:00 2001
From: ap-justin <89639563+ap-justin@users.noreply.github.com>
Date: Tue, 10 Sep 2024 18:14:36 +0800
Subject: [PATCH] compact donations received
---
.../Charity/Dashboard/Schedule/Schedule.tsx | 65 +++++++++++--------
1 file changed, 39 insertions(+), 26 deletions(-)
diff --git a/src/pages/Admin/Charity/Dashboard/Schedule/Schedule.tsx b/src/pages/Admin/Charity/Dashboard/Schedule/Schedule.tsx
index 160cdb8176..3bff5f538b 100644
--- a/src/pages/Admin/Charity/Dashboard/Schedule/Schedule.tsx
+++ b/src/pages/Admin/Charity/Dashboard/Schedule/Schedule.tsx
@@ -46,23 +46,6 @@ export function Schedule(props: Props) {
Distribution
-
- }
- >
-
- We process donations monthly, with a minimum balance requirement of
- ${MIN_PROCESSING_AMOUNT} per bucket. If your balance in any bucket
- is below ${MIN_PROCESSING_AMOUNT}, it will be carried over to the
- next month until it exceeds $50
-
-
-
{presetOpt ? (
{presetOpt.icon}
@@ -84,7 +67,7 @@ export function Schedule(props: Props) {
-
+
}
title={
@@ -107,18 +90,42 @@ export function Schedule(props: Props) {
}
- pct={endow?.allocation?.cash ?? 0}
+ pct={allocation.cash}
+ amount={props.amount}
+ tooltip={(val) =>
+ val !== 0 &&
+ val < MIN_PROCESSING_AMOUNT && (
+
+ }
+ >
+
+ Grant amount of $ {humanize(val)} is less than minimum
+ processing amount of ${MIN_PROCESSING_AMOUNT} and would be
+ carried over to the next month.
+
+
+
+ )
+ }
/>
|
}
title={
Savings}
- pct={endow?.allocation?.liq ?? 50}
+ pct={allocation.liq}
+ amount={props.amount}
/>
|
}
title={
Investments}
- pct={endow?.allocation?.lock ?? 50}
+ pct={allocation.lock}
+ amount={props.amount}
/>
@@ -126,18 +133,24 @@ export function Schedule(props: Props) {
}
interface IRow {
+ amount: number;
pct: number;
icon: ReactNode;
title: ReactNode;
+ tooltip?: (val: number) => ReactNode;
}
-function Row({ pct, icon, title }: IRow) {
+function Row(props: IRow) {
+ const val = props.amount * (props.pct / 100);
return (
- {icon}
- {title}
-
- {pct ?? 50} %
+ {props.icon}
+ {props.title}
+
+ {props.pct ?? 50} %
+ $
+ {humanize(val)}
+ {props.tooltip?.(val)}
);
}