Skip to content

Commit

Permalink
add save actin
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-justin committed Sep 11, 2024
1 parent b45d7c2 commit f30fa7b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/Admin/Charity/Dashboard/Loaded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function Loaded({
"liq-cash": 0,
"liq-lock": 0,
"lock-cash": 0,
"lock-liq": 0,
};

const liqDeductions = Object.entries(mov).reduce(
Expand All @@ -42,6 +43,7 @@ export function Loaded({
"liq-cash": props.donationsBal - liqDeductions,
"liq-lock": props.donationsBal - liqDeductions,
"lock-cash": props.sustainabilityFundBal - lockDeductions,
"lock-liq": props.sustainabilityFundBal - lockDeductions,
};

return (
Expand Down
15 changes: 15 additions & 0 deletions src/pages/Admin/Charity/Dashboard/LockActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ export function LockActions({ classes = "", ...props }: Props) {
const { showModal } = useModalContext();
return (
<div className={`${classes} flex justify-end`}>
<button
type="button"
onClick={() =>
showModal(MoveFundForm, {
type: "lock-liq",
balance: props.balance,
mov: props.mov,
endowId: props.endowId,
effect: "append",
})
}
className="text-xs uppercase bg-blue-d1 text-white px-2 py-1 rounded-sm font-heading hover:bg-blue"
>
save
</button>
<button
type="button"
onClick={() =>
Expand Down
5 changes: 5 additions & 0 deletions src/pages/Admin/Charity/Dashboard/Movements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const asset: {
icon: <Icon type="Sprout" className="text-green" />,
source: "Savings",
},
"lock-liq": {
title: "Save",
icon: <Icon type="PiggyBank" className="text-navy-l1" />,
source: "Investment",
},
};

interface Props {
Expand Down
2 changes: 2 additions & 0 deletions src/types/aws/apes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export interface BalanceMovement {
"liq-cash": number;
/** withdrawal from sustainability fund */
"lock-cash": number;
/** savings */
"lock-liq": number;
}

export type EndowmentBalances = {
Expand Down

0 comments on commit f30fa7b

Please sign in to comment.