-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: expose basic webpage for card
- Loading branch information
Nicolas Burtey
committed
Sep 21, 2023
1 parent
ed7fb77
commit 59bda84
Showing
12 changed files
with
191 additions
and
93 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
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,9 +1,71 @@ | ||
export default function Home({ params }: { params: { id: string } }) { | ||
import { serverApi } from "@/services/config" | ||
|
||
export default async function Home({ params }: { params: { id: string } }) { | ||
const { id } = params | ||
|
||
const cardApi = `${serverApi}/card/id/${id}` | ||
const cardResult = await fetch(cardApi, { cache: "no-store" }) | ||
const cardInfo = await cardResult.json() | ||
|
||
const transactionsApi = `${serverApi}/card/id/${id}/transactions` | ||
const transactionsResult = await fetch(transactionsApi) | ||
const transactionInfo = await transactionsResult.json() | ||
|
||
return ( | ||
<main className="flex min-h-screen items-center justify-center"> | ||
<h1>cardId: {id}</h1> | ||
<main className="flex flex-col min-h-screen items-center justify-center"> | ||
<h1>boltcard</h1> | ||
|
||
<section className="my-4"> | ||
<h2>Card Information:</h2> | ||
<ul> | ||
<li> | ||
<strong>ID:</strong> {cardInfo.id} | ||
</li> | ||
<li> | ||
<strong>UID:</strong> {cardInfo.uid} | ||
</li> | ||
<li> | ||
<strong>Onchain Address:</strong> {cardInfo.onchainAddress} | ||
</li> | ||
<li> | ||
<strong>Enabled:</strong> {cardInfo.enabled ? "Yes" : "No"} | ||
</li> | ||
</ul> | ||
</section> | ||
|
||
<section className="my-4"> | ||
<h2>Transactions:</h2> | ||
<ul> | ||
{transactionInfo.map((tx, index) => ( | ||
<li key={tx.id} className="mb-2"> | ||
<strong>Transaction {index + 1}:</strong> | ||
<ul> | ||
<li> | ||
<strong>ID:</strong> {tx.id} | ||
</li> | ||
<li> | ||
<strong>Status:</strong> {tx.status} | ||
</li> | ||
<li> | ||
<strong>Direction:</strong> {tx.direction} | ||
</li> | ||
<li> | ||
<strong>Memo:</strong> {tx.memo} | ||
</li> | ||
<li> | ||
<strong>Amount:</strong> {tx.settlementDisplayAmount}{" "} | ||
{tx.settlementDisplayCurrency} | ||
</li> | ||
<li> | ||
<strong>Fee:</strong> {tx.settlementDisplayFee}{" "} | ||
{tx.settlementDisplayCurrency} | ||
</li> | ||
{/* Add more fields as required */} | ||
</ul> | ||
</li> | ||
))} | ||
</ul> | ||
</section> | ||
</main> | ||
) | ||
} |
Binary file not shown.
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