From f611546a0fe67efeb471d094210879f8b4286245 Mon Sep 17 00:00:00 2001
From: Afolami Anuoluwapo <161776085+aabxtract@users.noreply.github.com>
Date: Fri, 19 Jun 2026 13:33:58 +0000
Subject: [PATCH 1/3] feat: add invoices management page with filtering and
searching capabilities
feat: create dashboard layout with authentication and sidebar navigation
feat: implement dashboard overview page with recent invoices and wallet information
feat: add settings page for managing merchant account and webhook configuration
feat: create reusable dashboard layout and navigation components
feat: implement header component displaying wallet status and balance
feat: add sidebar navigation for easy access to dashboard sections
feat: create custom hook for fetching merchant wallet information
---
legacy/webapp/app/dashboard/layout.tsx | 13 +
legacy/webapp/app/invoices/layout.tsx | 13 +
legacy/webapp/app/settings/layout.tsx | 13 +
legacy/webapp/app/settings/page.tsx | 73 +++++
.../components/merchant-dashboard-shell.tsx | 153 ++++++++++
legacy/webapp/package-lock.json | 10 -
web/app/dashboard/invoices/page.tsx | 256 ++++++++++++++++
web/app/dashboard/layout.tsx | 13 +
web/app/dashboard/page.tsx | 282 ++++++++++++++++++
web/app/dashboard/settings/page.tsx | 197 ++++++++++++
web/app/globals.css | 24 +-
web/app/layout.tsx | 3 +-
web/components/dashboard-layout.tsx | 21 ++
web/components/dashboard-nav.ts | 34 +++
web/components/header.tsx | 120 ++++++++
web/components/sidebar.tsx | 56 ++++
web/hooks/use-merchant.ts | 68 +++++
17 files changed, 1333 insertions(+), 16 deletions(-)
create mode 100644 legacy/webapp/app/dashboard/layout.tsx
create mode 100644 legacy/webapp/app/invoices/layout.tsx
create mode 100644 legacy/webapp/app/settings/layout.tsx
create mode 100644 legacy/webapp/app/settings/page.tsx
create mode 100644 legacy/webapp/components/merchant-dashboard-shell.tsx
create mode 100644 web/app/dashboard/invoices/page.tsx
create mode 100644 web/app/dashboard/layout.tsx
create mode 100644 web/app/dashboard/page.tsx
create mode 100644 web/app/dashboard/settings/page.tsx
create mode 100644 web/components/dashboard-layout.tsx
create mode 100644 web/components/dashboard-nav.ts
create mode 100644 web/components/header.tsx
create mode 100644 web/components/sidebar.tsx
create mode 100644 web/hooks/use-merchant.ts
diff --git a/legacy/webapp/app/dashboard/layout.tsx b/legacy/webapp/app/dashboard/layout.tsx
new file mode 100644
index 0000000..4f50be1
--- /dev/null
+++ b/legacy/webapp/app/dashboard/layout.tsx
@@ -0,0 +1,13 @@
+import { ReactNode } from "react"
+import { MerchantDashboardShell } from "@/components/merchant-dashboard-shell"
+
+export default function DashboardLayout({ children }: { children: ReactNode }) {
+ return (
+
Wallet
++ {connected ? displayAddress : "Not connected"} +
++ {address ? "Connected via your EVM wallet" : "Connect a wallet to authenticate"} +
+Session
++ {user?.walletAddress || "No active session"} +
++ Session data is stored locally for the legacy frontend. +
++ Merchant Dashboard +
+{description}
++ Manage all your invoices in one place +
+Total
++ {isLoading ? '...' : stats.total} +
+Paid
++ {isLoading ? '...' : stats.paid} +
+Pending
++ {isLoading ? '...' : stats.pending} +
+Draft
++ {isLoading ? '...' : stats.draft} +
+No invoices found
+ + Create Your First Invoice + +| + Invoice + | ++ Client + | ++ Amount + | ++ Due Date + | ++ Status + | ++ Action + | +
|---|---|---|---|---|---|
| + + {invoice.number} + + | +
+ {invoice.clientName}
+
+ {invoice.clientEmail}
+
+ |
+ + {invoice.amount} {invoice.currency} + | ++ {formatDate(invoice.dueDate)} + | ++ + {invoice.status.charAt(0).toUpperCase() + invoice.status.slice(1)} + + | ++ + View + + | +
+ Manage your invoices and monitor your merchant wallet activity +
+Total Invoices
++ {invoicesLoading ? '...' : stats.totalInvoices} +
+Paid Invoices
++ {invoicesLoading ? '...' : stats.paidInvoices} +
+Pending Amount
++ {invoicesLoading ? '...' : `$${stats.pendingAmount}`} +
+Overdue
++ {invoicesLoading ? '...' : stats.overdueCount} +
+Wallet Address
++ {wallet.publicKey} +
+Balance
++ {wallet.balance} {wallet.currency} +
+ {wallet.balanceUSD && ( ++ ≈ ${wallet.balanceUSD} +
+ )} +Merchant ID
++ {wallet.id} +
+No invoices yet
+ + Create Invoice + +| + Invoice + | ++ Client + | ++ Amount + | ++ Status + | ++ Date + | +
|---|---|---|---|---|
| + + {invoice.number} + + | ++ {invoice.clientName} + | ++ {invoice.amount} {invoice.currency} + | ++ + {invoice.status.charAt(0).toUpperCase() + invoice.status.slice(1)} + + | ++ {formatDate(invoice.createdAt)} + | +
+ Manage your merchant account and preferences +
++ The name displayed on your invoices +
++ Used for invoice notifications and account recovery +
+
+ {publicKey || 'Not connected'}
+
+ + This is your Stellar public key used for authentication +
+
+ {wallet.id}
+
+ + Unique identifier for your merchant account +
++ Receive payment notifications and invoice updates +
++ These actions cannot be undone. +
+ ++ Merchant Dashboard +
+ + {statusLabel} + ++ {merchantWallet ? formatAddress(merchantWallet) : 'Connecting to backend wallet context'} +
+Balance
++ {isLoading ? 'Loading...' : `${wallet?.balance || '0'} ${wallet?.currency || 'XLM'}`} +
+ {wallet?.balanceUSD && ( +≈ ${wallet.balanceUSD}
+ )} +Wallet
+{formatAddress(merchantWallet)}
+Balance
++ {isLoading ? 'Loading...' : `${wallet?.balance || '0'} ${wallet?.currency || 'XLM'}`} +
+- Merchant Dashboard -
- - {statusLabel} - -- {merchantWallet ? formatAddress(merchantWallet) : 'Connecting to backend wallet context'} -
-Balance
-- {isLoading ? 'Loading...' : `${wallet?.balance || '0'} ${wallet?.currency || 'XLM'}`} -
- {wallet?.balanceUSD && ( -≈ ${wallet.balanceUSD}
- )} -