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

Commit

Permalink
chore: remove balance cards in wallet screen
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Jul 2, 2024
1 parent 9294553 commit 027fec2
Showing 1 changed file with 2 additions and 84 deletions.
86 changes: 2 additions & 84 deletions frontend/src/screens/wallet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
import {
ArrowDown,
ArrowDownIcon,
ArrowUp,
ArrowUpIcon,
CreditCard,
} from "lucide-react";
import { ArrowDownIcon, ArrowUpIcon, CreditCard } from "lucide-react";
import { Link } from "react-router-dom";
import AppHeader from "src/components/AppHeader";
import BreezRedeem from "src/components/BreezRedeem";
import ExternalLink from "src/components/ExternalLink";
import Loading from "src/components/Loading";
import TransactionsList from "src/components/TransactionsList";
import { Button } from "src/components/ui/button";
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "src/components/ui/card";
import { useBalances } from "src/hooks/useBalances";
import { useInfo } from "src/hooks/useInfo";

function Wallet() {
const { data: info, hasChannelManagement } = useInfo();
const { data: info } = useInfo();
const { data: balances } = useBalances();

if (!info || !balances) {
Expand Down Expand Up @@ -63,75 +50,6 @@ function Wallet() {
</div>
</div>

<div className="grid grid-cols-1 lg:grid-cols-2 gap-5">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Spending Balance
</CardTitle>
<ArrowUp 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>
)}
{balances && (
<div className="text-2xl font-bold">
{new Intl.NumberFormat(undefined, {}).format(
Math.floor(balances.lightning.totalSpendable / 1000)
)}{" "}
sats
</div>
)}
</CardContent>
{hasChannelManagement && (
<CardFooter className="flex justify-end">
<Link to="/channels/outgoing">
<Button variant="outline">Top Up</Button>
</Link>
</CardFooter>
)}
</Card>
{hasChannelManagement && (
<Card>
<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 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>
)}
</div>

<TransactionsList />
</>
);
Expand Down

0 comments on commit 027fec2

Please sign in to comment.