Skip to content

Commit

Permalink
feat: Hide collect button if there isn't any position to collect
Browse files Browse the repository at this point in the history
  • Loading branch information
danielr18 committed Jan 23, 2025
1 parent d1e2da5 commit 3152e14
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
46 changes: 24 additions & 22 deletions apps/web/src/ui/pool/ConcentratedLiquidityCollectAllWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,30 @@ export const ConcentratedLiquidityCollectAllWidget: FC<
<DialogReview>
{({ confirm }) => (
<>
<div className="ml-auto">
<Checker.Connect className="min-w-[160px]" size="sm" fullWidth>
<Checker.Network
className="min-w-[160px]"
size="sm"
fullWidth
chainId={chainId}
>
<DialogTrigger asChild>
<Button
className="min-w-[160px]"
size="sm"
fullWidth
disabled={!aggregatedAmounts.length}
testId="claim-fees-all"
>
Claim Fees
</Button>
</DialogTrigger>
</Checker.Network>
</Checker.Connect>
</div>
{aggregatedAmounts.length > 0 ? (
<div className="ml-auto">
<Checker.Connect className="min-w-[160px]" size="sm" fullWidth>
<Checker.Network
className="min-w-[160px]"
size="sm"
fullWidth
chainId={chainId}
>
<DialogTrigger asChild>
<Button
className="min-w-[160px]"
size="sm"
fullWidth
disabled={!aggregatedAmounts.length}
testId="claim-fees-all"
>
Claim Fees
</Button>
</DialogTrigger>
</Checker.Network>
</Checker.Connect>
</div>
) : null}

<DialogContent>
<DialogHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export const ConcentratedPositionsTable: FC<ConcentratedPositionsTableProps> =
({_positions.length})
</span>
</span>
{actions}
{!hideCollectAllButton ? (
<ConcentratedLiquidityCollectAllWidget
positions={_positions}
Expand Down Expand Up @@ -164,6 +163,7 @@ export const ConcentratedPositionsTable: FC<ConcentratedPositionsTableProps> =
</Button>
</LinkInternal>
) : null}
{actions}
</div>
</CardTitle>
</CardHeader>
Expand Down

0 comments on commit 3152e14

Please sign in to comment.