Skip to content

Commit

Permalink
add back swaps and do some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed May 2, 2024
1 parent 95cad9a commit 60c9da8
Show file tree
Hide file tree
Showing 9 changed files with 870 additions and 91 deletions.
3 changes: 2 additions & 1 deletion public/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@
"import_state": "Import State From File",
"confirm_replace": "Do you want to replace your state with",
"password": "Enter your password to decrypt",
"decrypt_wallet": "Decrypt Wallet"
"decrypt_wallet": "Decrypt Wallet",
"decrypt_export": "Enter your password to save"
},
"logs": {
"title": "Download debug logs",
Expand Down
19 changes: 12 additions & 7 deletions src/components/BalanceBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { A, useNavigate } from "@solidjs/router";
import { Shuffle, Users } from "lucide-solid";
import { Match, Show, Suspense, Switch } from "solid-js";
import { createMemo, Match, Show, Suspense, Switch } from "solid-js";

import {
AmountFiat,
Expand Down Expand Up @@ -51,13 +51,18 @@ export function BalanceBox(props: { loading?: boolean; small?: boolean }) {
const navigate = useNavigate();
const i18n = useI18n();

const totalOnchain = () =>
(state.balance?.confirmed || 0n) +
(state.balance?.unconfirmed || 0n) +
(state.balance?.force_close || 0n);
const totalOnchain = createMemo(
() =>
(state.balance?.confirmed || 0n) +
(state.balance?.unconfirmed || 0n) +
(state.balance?.force_close || 0n)
);

const usableOnchain = () =>
(state.balance?.confirmed || 0n) + (state.balance?.unconfirmed || 0n);
const usableOnchain = createMemo(
() =>
(state.balance?.confirmed || 0n) +
(state.balance?.unconfirmed || 0n)
);

return (
<VStack>
Expand Down
3 changes: 2 additions & 1 deletion src/components/ImportExport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ export function ImportExport(props: { emergency?: boolean }) {
{/* TODO: this is pretty redundant with the DecryptDialog, could make a shared component */}
<SimpleDialog
title={i18n.t(
"settings.emergency_kit.import_export.confirm_replace"
"settings.emergency_kit.import_export.decrypt_export"
)}
open={exportDecrypt()}
setOpen={() => setExportDecrypt(false)}
>
<form onSubmit={savePassword}>
<div class="flex flex-col gap-4">
Expand Down
6 changes: 5 additions & 1 deletion src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import {
RequestRoute,
Scanner,
Search,
Send
Send,
Swap,
SwapLightning
} from "~/routes";
import {
Admin,
Expand Down Expand Up @@ -175,6 +177,8 @@ export function Router() {
<Route path="/request/:id" component={RequestRoute} />
<Route path="/scanner" component={Scanner} />
<Route path="/send" component={Send} />
<Route path="/swap" component={Swap} />
<Route path="/swaplightning" component={SwapLightning} />
<Route path="/search" component={Search} />
<Route path="/settings">
<Route path="/" component={Settings} />
Expand Down
Loading

0 comments on commit 60c9da8

Please sign in to comment.