From 251b87897134cf0fa1a4eafc6185d646c6f88c9a Mon Sep 17 00:00:00 2001 From: Dopezapha Date: Sat, 29 Aug 2026 07:09:53 +0100 Subject: [PATCH] fix: add deposit validation and timeline calendar controls --- apps/web/components/BondTimeline.tsx | 20 ++++++++++- apps/web/components/DepositWizard.tsx | 52 ++++++++++++++++++++------- 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/apps/web/components/BondTimeline.tsx b/apps/web/components/BondTimeline.tsx index 1d8e3e4..d83b89b 100644 --- a/apps/web/components/BondTimeline.tsx +++ b/apps/web/components/BondTimeline.tsx @@ -134,11 +134,23 @@ export function BondTimeline({ return () => document.removeEventListener('mousedown', handleClickOutside); }, [selectedEvent]); + const now = new Date(); + const isViewingCurrentMonth = + currentMonth.getFullYear() === now.getFullYear() && + currentMonth.getMonth() === now.getMonth(); + return (

Bond Timeline

-
+
+
+ {events.length === 0 && ( +
+ No bond activity yet this month +
+ )} +
{['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].map((day) => ( diff --git a/apps/web/components/DepositWizard.tsx b/apps/web/components/DepositWizard.tsx index 9720f18..2f2cf0a 100644 --- a/apps/web/components/DepositWizard.tsx +++ b/apps/web/components/DepositWizard.tsx @@ -48,24 +48,41 @@ export function DepositWizard({ const bucketLabel = bucket === 'collateral' ? 'Collateral' : 'Reserve (auto-top-up pool)'; + const parsedXlm = Number(xlm); + const amountError = + !xlm || xlm.trim() === '' + ? 'Please enter a deposit amount.' + : isNaN(parsedXlm) || parsedXlm <= 0 + ? 'Amount must be greater than 0 XLM.' + : parsedXlm < 0.1 + ? 'Minimum deposit amount is 0.1 XLM.' + : null; + return (
{step === 'amount' && ( <> -
- setXlm(e.target.value)} - placeholder="XLM" - className="flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-accent focus:outline-none" - /> +
+
+ setXlm(e.target.value)} + placeholder="XLM" + className="flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-accent focus:outline-none" + /> +
+

Minimum deposit amount: 0.1 XLM

+ {amountError &&

{amountError}

}
@@ -133,7 +150,16 @@ export function DepositWizard({ {xlm} XLM deposited to {bucketLabel.toLowerCase()}

{txHash && ( -

{txHash.slice(0, 16)}…

+

+ + {txHash.slice(0, 16)}… ↗ + +

)}