Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: handle fiat chain id #2606

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ? (
<>- - -</>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace placeholder and reduce nesting

) : (
<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