Skip to content

Commit

Permalink
Add payment tx links in /my-grants (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pabl0cks authored Mar 25, 2024
1 parent 2b28aaf commit db69f7b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/nextjs/app/my-grants/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { SubmitModal } from "./_components/SubmitModal";
import { NextPage } from "next";
import useSWR from "swr";
import { useAccount } from "wagmi";
import { ArrowTopRightOnSquareIcon } from "@heroicons/react/20/solid";
import { GrantData } from "~~/services/database/schema";
import { PROPOSAL_STATUS } from "~~/utils/grants";
import { getBlockExplorerTxLink } from "~~/utils/scaffold-eth";

const badgeBgColor = {
[PROPOSAL_STATUS.PROPOSED]: "bg-warning",
Expand Down Expand Up @@ -50,6 +52,26 @@ const MyGrants: NextPage = () => {
)}
<p className="m-0">{grant.description}</p>
<p className={`badge ${badgeBgColor[grant.status]}`}>{grant.status}</p>
{grant.approvedTx && (
<a
href={getBlockExplorerTxLink(Number(grant.txChainId), grant.approvedTx)}
target="_blank"
rel="noopener noreferrer"
className="ml-4 underline underline-offset-4 text-xs"
>
50% approve tx <ArrowTopRightOnSquareIcon className="h-4 w-4 inline" />
</a>
)}
{grant.completedTx && (
<a
href={getBlockExplorerTxLink(Number(grant.txChainId), grant.completedTx)}
target="_blank"
rel="noopener noreferrer"
className="ml-4 underline underline-offset-4 text-xs"
>
50% complete tx <ArrowTopRightOnSquareIcon className="h-4 w-4 inline" />
</a>
)}
{grant.status === PROPOSAL_STATUS.APPROVED && (
<button onClick={() => openModal(grant)} className="btn btn-primary float-right">
Submit build
Expand Down

0 comments on commit db69f7b

Please sign in to comment.