From 1c17cc129d72692cc17e3208cfb8d65982e52708 Mon Sep 17 00:00:00 2001 From: Abidoyesimze Date: Wed, 25 Feb 2026 16:05:41 +0100 Subject: [PATCH] feat: add Albedo and xBull wallet support to WalletModal - Added Albedo and xBull to SUPPORTED_WALLETS array - Implemented mock connection functions for Albedo and xBull wallets - Updated WalletModal to display all three wallets with wallet-specific notes - Updated footer to show all supported wallets - Fixed lint warnings in wallet-entry and WalletButton components --- .../components/dashboard/dashboard-view.tsx | 83 ++++++++++-------- frontend/components/wallet/WalletButton.tsx | 9 +- frontend/components/wallet/WalletModal.tsx | 9 +- frontend/components/wallet/wallet-entry.tsx | 87 ++++--------------- frontend/context/wallet-context.tsx | 2 +- frontend/lib/wallet.ts | 63 +++++++++++++- 6 files changed, 137 insertions(+), 116 deletions(-) diff --git a/frontend/components/dashboard/dashboard-view.tsx b/frontend/components/dashboard/dashboard-view.tsx index 7d27cdd..f1440bd 100644 --- a/frontend/components/dashboard/dashboard-view.tsx +++ b/frontend/components/dashboard/dashboard-view.tsx @@ -239,17 +239,17 @@ function renderStreams( onShowDetails(stream); }} > - {stream.date} - - {stream.recipient} - - - {stream.deposited} {stream.token} - - - {stream.withdrawn} {stream.token} - - + {stream.date} + + {stream.recipient} + + + {stream.deposited} {stream.token} + + + {stream.withdrawn} {stream.token} + +
{/^\d+$/.test(stream.id) ? ( ) : null} - + > + Add Funds +
- - - ))} + + + ))} @@ -432,6 +432,15 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) { setStreamFormMessage(null); }; + const handleTopUp = (streamId: string) => { + const amount = prompt(`Enter amount to add to stream ${streamId}:`); + if (amount && !Number.isNaN(parseFloat(amount)) && parseFloat(amount) > 0) { + console.log(`Adding ${amount} funds to stream ${streamId}`); + // TODO: Integrate with Soroban contract's top_up_stream function + alert(`Successfully added ${amount} to stream ${streamId}`); + } + }; + const handleApplyTemplate = (templateId: string) => { const template = templates.find((item) => item.id === templateId); if (!template) return; @@ -503,8 +512,8 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) { setTemplates((prev) => prev.filter((item) => item.id !== templateId)); if (selectedTemplateId === templateId) setSelectedTemplateId(null); if (editingTemplateId === templateId) { - setEditingTemplateId(null); - setTemplateNameInput(""); + setEditingTemplateId(null); + setTemplateNameInput(""); } }; @@ -688,7 +697,7 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) { (endDate.getTime() - startDate.getTime()) / 1000, ); if (durationSeconds <= 0) { - setStreamFormMessage({ + setStreamFormMessage({ text: "End time must be after start time.", tone: "error", }); @@ -708,8 +717,8 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) { handleResetStreamForm(); setStreamFormMessage({ text: "Stream submitted to wallet and confirmed on-chain.", - tone: "success", - }); + tone: "success", + }); } catch (err) { setStreamFormMessage({ text: toSorobanErrorMessage(err), @@ -996,18 +1005,18 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) {
- +