Skip to content

Commit

Permalink
Merge pull request #72 from penumbra-zone/#6-transaction
Browse files Browse the repository at this point in the history
Link to block height and show all ABCI events on Transaction
  • Loading branch information
ejmg authored Mar 12, 2024
2 parents 18880ce + 11402f1 commit 810e961
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/app/api/transaction/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ export async function GET(req: Request) {
},
},
},
where: {
NOT: {
type: "tx",
},
},
},
blocks: {
select: {
Expand Down
6 changes: 3 additions & 3 deletions src/app/transaction/[hash]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const Page : FC<PageProps> = ({ params }) => {
{isFetched ? (
<div>
{txData ? (
<div className="flex flex-col justify-center w-full">
<h1 className="text-3xl mx-auto py-5 font-semibold">Transaction Event Summary</h1>
<Transaction txPayload={txData} />
<div className="flex flex-col items-center gap-5">
<h1 className="sm:text-2xl font-bold">Transaction Event Summary</h1>
<Transaction txData={txData} />
</div>
) : (
<p>No results</p>
Expand Down
9 changes: 5 additions & 4 deletions src/components/Transaction/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { type TransactionResultPayload } from "@/lib/validators/search";
import ReactJson from "@microlink/react-json-view";
import Link from "next/link";
import { type FC } from "react";

interface TransactionProps {
txPayload: TransactionResultPayload
txData: TransactionResultPayload
}

const Transaction : FC<TransactionProps> = ({ txPayload }) => {
const [txEvent, penumbraTx] = txPayload;
const Transaction : FC<TransactionProps> = ({ txData }) => {
const [txEvent, penumbraTx] = txData;
return (
<div className="bg-white rounded-sm">
<div className="flex flex-wrap justify-between p-5 gap-y-10 w-full">
Expand All @@ -17,7 +18,7 @@ const Transaction : FC<TransactionProps> = ({ txPayload }) => {
</div>
<div className="flex justify-start w-full">
<p className="w-1/6">Block Height</p>
<pre>{txEvent.blocks.height.toString()}</pre>
<Link href={`/block/${txEvent.blocks.height}`}><pre className="underline">{txEvent.blocks.height.toString()}</pre></Link>
</div>
<div className="flex justify-start w-full">
<p className="w-1/6">Timestamp</p>
Expand Down

0 comments on commit 810e961

Please sign in to comment.