Skip to content

Commit

Permalink
handle fiat chainID
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-justin committed Dec 20, 2023
1 parent 705a9d1 commit 1db2117
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
28 changes: 13 additions & 15 deletions src/pages/Admin/Charity/Donations/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,19 @@ export default function Table({
<>{humanize(amount, 3)}</>
<>{humanize(amount * (+splitLiq / 100), 3)}</>
<>{humanize(amount * ((100 - +splitLiq) / 100), 3)}</>
<>
{chainId === "staging" ? (
<span className="text-gray-d1 dark:text-gray text-sm">
&lt; TX Link &gt;
</span>
) : (
<ExtLink
//default to ethereum for staging
href={getTxUrl(chainId, hash)}
className="text-center text-blue hover:text-blue-l2 cursor-pointer uppercase text-sm"
>
{maskAddress(hash)}
</ExtLink>
)}
</>

{chainId === "staging" || chainId === "fiat" ? (
<>- - -</>
) : (
<ExtLink
//default to ethereum for staging
href={getTxUrl(chainId, hash)}
className="text-center text-blue hover:text-blue-l2 cursor-pointer uppercase text-sm"
>
{maskAddress(hash)}
</ExtLink>
)}

<td className="relative">
{!kycData ? (
<Icon
Expand Down
20 changes: 10 additions & 10 deletions src/pages/Donations/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ export default function Table({
<span className="font-body text-sm">{row.symbol}</span>
<>{humanize(row.amount, 3)}</>
<>{`$${humanize(row.usdValue, 2)}`}</>
<ExtLink
href={getTxUrl(
//default to ethereum for staging
row.chainId === "staging" ? "1" : row.chainId,
row.hash
)}
className="text-center text-blue hover:text-blue-l2 cursor-pointer uppercase text-sm"
>
{row.hash}
</ExtLink>
{row.chainId === "fiat" || row.chainId === "staging" ? (
<>- - -</>
) : (
<ExtLink
href={getTxUrl(row.chainId, row.hash)}
className="text-center text-blue hover:text-blue-l2 cursor-pointer uppercase text-sm"
>
{row.hash}
</ExtLink>
)}
<div className="text-center text-white">
<span
className={`${
Expand Down
2 changes: 1 addition & 1 deletion src/types/aws/apes/donation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type KYCData = {

type DonationRecordBase = {
amount: number;
chainId: ChainID | "staging";
chainId: ChainID | "staging" | "fiat";
date: string;
hash: string;
symbol: string;
Expand Down

0 comments on commit 1db2117

Please sign in to comment.