Skip to content

Commit

Permalink
fixed button manager for deposit/tip button
Browse files Browse the repository at this point in the history
  • Loading branch information
dan13ram committed Dec 30, 2024
1 parent 3738c1c commit 3c5908c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/forms/src/InvoiceButtonManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/PaymentsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/ReleaseFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Text>
<Stack
my="2rem"
Expand Down

0 comments on commit 3c5908c

Please sign in to comment.