-
Notifications
You must be signed in to change notification settings - Fork 621
Dashboard: Show Purchase data in bridge tx page, add tx status card in project>bridge page #8251
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ import { | |
| Clock4Icon, | ||
| InfoIcon, | ||
| } from "lucide-react"; | ||
| import { notFound } from "next/navigation"; | ||
| import { toTokens } from "thirdweb"; | ||
| import { status } from "thirdweb/bridge"; | ||
| import type { ChainMetadata } from "thirdweb/chains"; | ||
|
|
@@ -55,19 +54,28 @@ export default async function Page(props: { | |
| const [transaction, receipt, bridgeStatus] = await Promise.all([ | ||
| eth_getTransactionByHash(rpcRequest, { | ||
| hash: params.txHash, | ||
| }), | ||
| }).catch(() => undefined), | ||
| eth_getTransactionReceipt(rpcRequest, { | ||
| hash: params.txHash, | ||
| }), | ||
| }).catch(() => undefined), | ||
| status({ | ||
| chainId: chain.chainId, | ||
| transactionHash: params.txHash, | ||
| client: serverThirdwebClient, | ||
| }).catch(() => undefined), | ||
| ]); | ||
MananTank marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if (!transaction.blockHash) { | ||
| notFound(); | ||
| if (!transaction?.blockHash || !receipt) { | ||
| return ( | ||
| <div className="flex flex-col items-center justify-center grow"> | ||
| <div className="flex flex-col items-center justify-center gap-3"> | ||
| <div className="p-2 rounded-full bg-background border"> | ||
| <CircleAlertIcon className="size-5 text-muted-foreground" /> | ||
| </div> | ||
| Transaction not found | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
Comment on lines
+68
to
79
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pending transactions will incorrectly show as "not found." The condition Consider one of these approaches:
Example differentiation: - if (!transaction?.blockHash || !receipt) {
+ if (!transaction) {
return (
<div className="flex flex-col items-center justify-center grow">
<div className="flex flex-col items-center justify-center gap-3">
<div className="p-2 rounded-full bg-background border">
<CircleAlertIcon className="size-5 text-muted-foreground" />
</div>
Transaction not found
</div>
</div>
);
+ }
+
+ if (!transaction.blockHash || !receipt) {
+ return (
+ <div className="flex flex-col items-center justify-center grow">
+ <div className="flex flex-col items-center justify-center gap-3">
+ <div className="p-2 rounded-full bg-background border">
+ <Clock4Icon className="size-5 text-muted-foreground" />
+ </div>
+ Transaction pending confirmation
+ </div>
+ </div>
+ );
}Optional: Add semantic HTML for accessibility. The plain text "Transaction not found" lacks semantic structure. Consider wrapping in a heading or paragraph tag with appropriate ARIA attributes for better screen reader support. Example: <div className="flex flex-col items-center justify-center gap-3">
<div className="p-2 rounded-full bg-background border">
<CircleAlertIcon className="size-5 text-muted-foreground" />
</div>
- Transaction not found
+ <p className="text-center">Transaction not found</p>
</div>
🤖 Prompt for AI Agents |
||
|
|
||
| const block = await eth_getBlockByHash(rpcRequest, { | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.