-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc fixes + raw logs component (#19)
* misc fixes + raw logs component * nit
- Loading branch information
Showing
18 changed files
with
167 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
app/(goldrush)/[chain_id]/transaction/[tx_hash]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
"use client"; | ||
|
||
import { SubNav } from "@/components/shared"; | ||
import { type TransactionLayoutProps } from "@/utils/types/pages.types"; | ||
import { TransactionDetails } from "@covalenthq/goldrush-kit"; | ||
import Link from "next/link"; | ||
|
||
const TransactionLayout: React.FC<TransactionLayoutProps> = ({ | ||
children, | ||
params: { tx_hash, chain_id }, | ||
}) => { | ||
const routes: { | ||
children: React.ReactNode; | ||
href: string; | ||
}[] = [ | ||
{ | ||
children: "Receipt", | ||
href: "receipt", | ||
}, | ||
{ | ||
children: "Raw Logs", | ||
href: "raw-logs", | ||
}, | ||
]; | ||
|
||
return ( | ||
<main className="gbk-flex gbk-w-full gbk-flex-col gbk-gap-4"> | ||
<TransactionDetails | ||
chain_name={chain_id} | ||
tx_hash={tx_hash} | ||
actionable_from={(from_address) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/address/${from_address}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
actionable_to={(to_address) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/address/${to_address}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
actionable_block={(block_height) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/block/${block_height}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
/> | ||
|
||
<SubNav routes={routes} /> | ||
|
||
{children} | ||
</main> | ||
); | ||
}; | ||
|
||
export default TransactionLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,12 @@ | ||
"use client"; | ||
|
||
import { type TransactionPageProps } from "@/utils/types/pages.types"; | ||
import { | ||
TransactionDetails, | ||
TransactionReceipt, | ||
} from "@covalenthq/goldrush-kit"; | ||
import Link from "next/link"; | ||
import { redirect } from "next/navigation"; | ||
|
||
const TransactionPage: React.FC<TransactionPageProps> = ({ | ||
params: { tx_hash, chain_id }, | ||
}) => { | ||
return ( | ||
<main className="gbk-flex gbk-w-full gbk-flex-col gbk-gap-4"> | ||
<TransactionDetails | ||
chain_name={chain_id} | ||
tx_hash={tx_hash} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
actionable_from={(from_address) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/address/${from_address}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
actionable_to={(to_address) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/address/${to_address}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
actionable_block={(block_height) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/block/${block_height}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
/> | ||
<TransactionReceipt | ||
chain_name={"eth-mainnet"} | ||
tx_hash={tx_hash} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
actionable_from={(from_address) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/address/${from_address}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
actionable_to={(to_address) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/address/${to_address}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
actionable_block={(block_height) => ({ | ||
parent: Link, | ||
parentProps: { | ||
href: `/${chain_id}/block/${block_height}`, | ||
className: "hover:gbk-underline", | ||
}, | ||
})} | ||
/> | ||
</main> | ||
); | ||
redirect(`/${chain_id}/transaction/${tx_hash}/receipt`); | ||
}; | ||
|
||
export default TransactionPage; |
12 changes: 12 additions & 0 deletions
12
app/(goldrush)/[chain_id]/transaction/[tx_hash]/raw-logs/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use client"; | ||
|
||
import { type TransactionPageProps } from "@/utils/types/pages.types"; | ||
import { TransactionRawLogs } from "@covalenthq/goldrush-kit"; | ||
|
||
const TransactionRawLogsPage: React.FC<TransactionPageProps> = ({ | ||
params: { tx_hash, chain_id }, | ||
}) => { | ||
return <TransactionRawLogs chain_name={chain_id} tx_hash={tx_hash} />; | ||
}; | ||
|
||
export default TransactionRawLogsPage; |
12 changes: 12 additions & 0 deletions
12
app/(goldrush)/[chain_id]/transaction/[tx_hash]/receipt/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use client"; | ||
|
||
import { type TransactionPageProps } from "@/utils/types/pages.types"; | ||
import { TransactionReceipt } from "@covalenthq/goldrush-kit"; | ||
|
||
const TransactionReceiptPage: React.FC<TransactionPageProps> = ({ | ||
params: { tx_hash, chain_id }, | ||
}) => { | ||
return <TransactionReceipt chain_name={chain_id} tx_hash={tx_hash} />; | ||
}; | ||
|
||
export default TransactionReceiptPage; |
Oops, something went wrong.