Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
chore: hide incoming capacity box if not availble
Browse files Browse the repository at this point in the history
if the backend does not have any channel management then the incoming
  capcity box does not make sense
  • Loading branch information
bumi committed Jun 30, 2024
1 parent 9a0c1d8 commit 7280ee1
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions frontend/src/screens/wallet/Receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,40 +214,41 @@ export default function Receive() {
</form>
)}
</div>
<Card className="w-full hidden md:block self-start">
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Receiving Capacity
</CardTitle>
<ArrowDown className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
{!balances && (
<div>
<div className="animate-pulse d-inline ">
<div className="h-2.5 bg-primary rounded-full w-12 my-2"></div>
{hasChannelManagement && (
<Card className="w-full hidden md:block self-start">
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Receiving Capacity
</CardTitle>
<ArrowDown className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
{!balances && (
<div>
<div className="animate-pulse d-inline ">
<div className="h-2.5 bg-primary rounded-full w-12 my-2"></div>
</div>
</div>
</div>
)}
<div className="text-2xl font-bold">
{balances && (
<>
{new Intl.NumberFormat().format(
Math.floor(balances.lightning.totalReceivable / 1000)
)}{" "}
sats
</>
)}
</div>
</CardContent>
{hasChannelManagement && (
<div className="text-2xl font-bold">
{balances && (
<>
{new Intl.NumberFormat().format(
Math.floor(balances.lightning.totalReceivable / 1000)
)}{" "}
sats
</>
)}
</div>
</CardContent>

<CardFooter className="flex justify-end">
<Link to="/channels/incoming">
<Button variant="outline">Increase</Button>
</Link>
</CardFooter>
)}
</Card>
</Card>
)}
</div>
</div>
);
Expand Down

0 comments on commit 7280ee1

Please sign in to comment.