From b47d2edf9fc9539cfe182573de6882bbce42a61c Mon Sep 17 00:00:00 2001 From: dan13ram Date: Mon, 30 Dec 2024 18:39:44 +0530 Subject: [PATCH] fixed button manager for deposit/tip button --- packages/forms/src/InvoiceButtonManager.tsx | 8 ++++++-- packages/forms/src/PaymentsForm.tsx | 2 +- packages/forms/src/ReleaseFunds.tsx | 2 +- packages/ui/src/molecules/Header.tsx | 5 ++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/forms/src/InvoiceButtonManager.tsx b/packages/forms/src/InvoiceButtonManager.tsx index 5c74a9fd..e2462fb0 100644 --- a/packages/forms/src/InvoiceButtonManager.tsx +++ b/packages/forms/src/InvoiceButtonManager.tsx @@ -76,12 +76,16 @@ export function InvoiceButtonManager({ const isFullPaid = due === BigInt(0); const bEnabled: ButtonEnabled = { - deposit: isClient && !isDisputed && !isFullPaid, + deposit: + (isClient || (!isProvider && !isResolver)) && + !isDisputed && + !isFullPaid, lock: (isProvider || isClient) && isLockable && !isDisputed, release: isReleasable && isClient && !isDisputed, resolve: isResolver && isLocked && isDisputed, withdraw: isClient && isWithdrawable && isExpired && !isDisputed, - tip: isClient && !isDisputed && isFullPaid, + tip: + (isClient || (!isProvider && !isResolver)) && !isDisputed && isFullPaid, }; const nColumns = _.size(_.pickBy(bEnabled, value => value === true)); diff --git a/packages/forms/src/PaymentsForm.tsx b/packages/forms/src/PaymentsForm.tsx index c922bbb5..4b0e94ab 100644 --- a/packages/forms/src/PaymentsForm.tsx +++ b/packages/forms/src/PaymentsForm.tsx @@ -28,10 +28,10 @@ import { Input, NumberInput, QuestionIcon, + ReactSelect, Textarea, useMediaStyles, } from '@smartinvoicexyz/ui'; -import { ReactSelect } from '@smartinvoicexyz/ui/src/forms/ReactSelect'; import { commify, escrowPaymentsSchema, diff --git a/packages/forms/src/ReleaseFunds.tsx b/packages/forms/src/ReleaseFunds.tsx index 78219b31..b093b0af 100644 --- a/packages/forms/src/ReleaseFunds.tsx +++ b/packages/forms/src/ReleaseFunds.tsx @@ -80,7 +80,7 @@ export function ReleaseFunds({ color="blackAlpha.800" > Follow the instructions in your wallet to release funds from the escrow - to provider account. + to the provider account.