Skip to content

Commit fc5c549

Browse files
committed
wip: matching estimate hook
1 parent 6ad987f commit fc5c549

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

packages/grant-explorer/src/features/round/ViewCartPage/SummaryBox.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import { BigNumber, ethers } from "ethers";
22
import React from "react";
33
import { PayoutToken } from "../../api/types";
4+
5+
function useMatchingEstimation(): {
6+
totalMatchingEstimation: bigint;
7+
} {
8+
return {
9+
totalMatchingEstimation: 0n,
10+
};
11+
}
12+
413
type SummaryBoxProps = {
514
payoutTokenPrice: number | undefined;
615
totalDonation: BigNumber;
716
selectedPayoutToken: PayoutToken;
817
};
18+
919
export function Summary({
1020
payoutTokenPrice,
1121
totalDonation,
@@ -20,6 +30,27 @@ export function Summary({
2030
return (
2131
<div className="shrink mb-5 block px-[16px] py-4 rounded-lg shadow-lg bg-white border border-violet-400 font-semibold">
2232
<h2 className="text-xl border-b-2 pb-2">Summary</h2>
33+
<div className="flex justify-between mt-4">
34+
<p>Estimated matching</p>
35+
<p>
36+
<span data-testid={"totalDonation"} className="mr-2">
37+
{ethers.utils.formatUnits(
38+
totalDonation,
39+
selectedPayoutToken.decimal
40+
)}
41+
</span>
42+
<span data-testid={"summaryPayoutToken"}>
43+
{selectedPayoutToken.name}
44+
</span>
45+
</p>
46+
</div>
47+
{payoutTokenPrice && (
48+
<div className="flex flex-row-reverse mt-2">
49+
<p className="text-[14px] text-grey-400">
50+
$ {totalDonationInUSD?.toFixed(2)}
51+
</p>
52+
</div>
53+
)}
2354
<div className="flex justify-between mt-4">
2455
<p>Your Contribution</p>
2556
<p>

0 commit comments

Comments
 (0)