Skip to content

Commit 0163afd

Browse files
feat: update direct donations table
1 parent 15478e5 commit 0163afd

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packages/grant-explorer/src/features/contributors/DirectDonationsTable.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getChainById, getTokenByChainIdAndAddress } from "common";
55
import { Hex, formatUnits } from "viem";
66
import { Contribution } from "data-layer";
77
import moment from "moment";
8+
import { TransactionButton } from "./TransactionButton";
89

910
export function DirectDonationsTable(props: { contributions: Contribution[] }) {
1011
return (
@@ -91,8 +92,8 @@ function Table(props: { contributions: Contribution[] }) {
9192
}
9293

9394
return (
94-
<tr key={contribution.id} className="">
95-
<td className="py-4 pr-2 w-2/5">
95+
<tr key={contribution.id} className="border-b">
96+
<td className="py-4 lg:px-2 w-2/5">
9697
<div className="flex items-center">
9798
<div className="flex flex-col sm:flex-row">
9899
{/* Link to the project */}
@@ -112,14 +113,22 @@ function Table(props: { contributions: Contribution[] }) {
112113
</div>
113114
</td>
114115
{/* Display donations */}
115-
<td className="py-4 truncate lg:pr-16">
116+
<td className="py-4 truncate w-2/5 lg:pl-2">
116117
<span className="font-bold">
117118
{formattedAmount}{" "}
118119
</span>
119120
<span className="text-grey-400">
120121
/ ${contribution.amountInUsd.toFixed(2)}
121122
</span>
122123
</td>
124+
<td className="truncate w-1/5 lg:pl-32">
125+
<div>
126+
<TransactionButton
127+
chainId={contribution.chainId}
128+
txHash={contribution.transactionHash}
129+
/>
130+
</div>
131+
</td>
123132
</tr>
124133
);
125134
})}

packages/grant-explorer/src/features/contributors/ViewContributionHistory.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ export function ViewContributionHistory(props: {
275275
</div>
276276
</div>
277277
<div className="text-2xl my-6">Donation History</div>
278-
<div className="text-lg bg-grey-75 text-black rounded-2xl pl-4 px-1 py-1 mb-2 font-semibold">
279-
Direct Donations
280-
</div>
281-
<DirectDonationsTable contributions={directAllocationDonations} />
282278
<div className="text-lg bg-grey-75 text-black rounded-2xl pl-4 px-1 py-1 mb-2 font-semibold">
283279
Active Rounds
284280
</div>
@@ -293,6 +289,10 @@ export function ViewContributionHistory(props: {
293289
contributions={pastRoundDonations}
294290
activeRound={false}
295291
/>
292+
<div className="text-lg bg-grey-75 text-black rounded-2xl pl-4 px-1 py-1 mb-2 font-semibold">
293+
Direct Donations
294+
</div>
295+
<DirectDonationsTable contributions={directAllocationDonations} />
296296
</main>
297297
<div className="mt-24 mb-11 h-11">
298298
<Footer />

0 commit comments

Comments
 (0)