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

[txHash].tsx page UI improvements #414

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
22 changes: 12 additions & 10 deletions packages/nextjs/pages/blockexplorer/transaction/[txHash].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const TransactionPage: NextPage = () => {
Back
</button>
{transaction ? (
<div className="overflow-x-auto">
<div>
<h2 className="text-3xl font-bold mb-4 text-center text-primary-content">Transaction Details</h2>{" "}
<table className="table w-full shadow-lg">
<tbody>
Expand Down Expand Up @@ -94,14 +94,16 @@ const TransactionPage: NextPage = () => {
<strong>Function called:</strong>
</td>
<td>
{functionCalled === "0x" ? (
"This transaction did not call any function."
) : (
<>
<span className="mr-2">{getFunctionDetails(transaction)}</span>
<span className="badge badge-primary font-bold">{functionCalled}</span>
</>
)}
<div className="w-full md:max-w-[600px] lg:max-w-[800px] overflow-x-auto whitespace-nowrap">
{functionCalled === "0x" ? (
"This transaction did not call any function."
) : (
<>
<span className="mr-2">{getFunctionDetails(transaction)}</span>
<span className="badge badge-primary font-bold">{functionCalled}</span>
</>
)}
</div>
</td>
</tr>
<tr>
Expand All @@ -115,7 +117,7 @@ const TransactionPage: NextPage = () => {
<strong>Data:</strong>
</td>
<td className="form-control">
<textarea readOnly value={transaction.input} className="p-0 textarea-primary bg-inherit" />
<textarea readOnly value={transaction.input} className="p-0 textarea-primary bg-inherit h-[150px]" />
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", "./utils/**/*.{js,ts,jsx,tsx}"],
plugins: [require("daisyui")],
plugins: [require("daisyui"), require("tailwind-scrollbar")],
portdeveloper marked this conversation as resolved.
Show resolved Hide resolved
darkTheme: "scaffoldEthDark",
// DaisyUI theme colors
daisyui: {
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/utils/scaffold-eth/decodeTxData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const getFunctionDetails = (transaction: TransactionType) => {
transaction.functionArgs
) {
const details = transaction.functionArgNames.map(
(name, i) => `${transaction.functionArgTypes?.[i] || ""} ${name} = ${transaction.functionArgs?.[i] || ""}`,
(name, i) => `${transaction.functionArgTypes?.[i] || ""} ${name} = ${transaction.functionArgs?.[i] ?? ""}`,
);
return `${transaction.functionName}(${details.join(", ")})`;
}
Expand Down