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

fix: remove savings balance card #516

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 29 additions & 50 deletions frontend/src/screens/channels/Channels.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
ArrowDown,
ArrowUp,
Bitcoin,
ChevronDown,
CopyIcon,
ExternalLinkIcon,
Expand Down Expand Up @@ -311,8 +310,31 @@ export default function Channels() {
</div>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuLabel>On-Chain</DropdownMenuLabel>
<DropdownMenuItem>
{balances && (
<>
{new Intl.NumberFormat().format(
balances.onchain.spendable
)}{" "}
sats
{balances &&
balances.onchain.spendable !==
balances.onchain.total && (
<p className="text-xs text-muted-foreground animate-pulse">
+
{new Intl.NumberFormat().format(
balances.onchain.total -
balances.onchain.spendable
)}{" "}
sats incoming
</p>
)}
</>
)}
</DropdownMenuItem>
<DropdownMenuItem>
<Link
to="/channels/onchain/deposit-bitcoin"
Expand Down Expand Up @@ -354,17 +376,17 @@ export default function Channels() {
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
{/* <Link to="/channels/new">
<Button>Open Channel</Button>
</Link> */}
<ExternalLink to="https://www.getalby.com/topup">
<Button>Buy Bitcoin</Button>
</ExternalLink>
</>
}
></AppHeader>

<div
className={cn(
"grid grid-cols-1 gap-3",
showHostedBalance ? "xl:grid-cols-4" : "lg:grid-cols-3"
showHostedBalance ? "xl:grid-cols-3" : "lg:grid-cols-2"
)}
>
{showHostedBalance && (
Expand Down Expand Up @@ -429,49 +451,6 @@ export default function Channels() {
</CardFooter>
</Card>
)}
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Savings Balance
</CardTitle>
<Bitcoin 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(balances.onchain.spendable)}{" "}
sats
{balances &&
balances.onchain.spendable !== balances.onchain.total && (
<p className="text-xs text-muted-foreground animate-pulse">
+
{new Intl.NumberFormat().format(
balances.onchain.total - balances.onchain.spendable
)}{" "}
sats incoming
</p>
)}
</>
)}
</div>
</CardContent>
<CardFooter className="flex justify-end space-x-1">
<Link to="onchain/buy-bitcoin">
<Button variant="outline">Buy</Button>
</Link>
<Link to="onchain/deposit-bitcoin">
<Button variant="outline">Deposit</Button>
</Link>
</CardFooter>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Expand All @@ -498,7 +477,7 @@ export default function Channels() {
</CardContent>
<CardFooter className="flex justify-end">
<Link to="/channels/outgoing">
<Button variant="outline">Increase</Button>
<Button variant="outline">Top Up</Button>
</Link>
</CardFooter>
</Card>
Expand Down
Loading