on-chain warnings and hide zero amounts

This commit is contained in:
Paul Miller
2024-05-09 11:56:20 -05:00
parent 37fc60b394
commit 336ec4b2cf
4 changed files with 21 additions and 3 deletions

View File

@@ -148,7 +148,9 @@
"body": "Lightning receives will automatically go into your chosen federation. You can swap to self-custodial later if you want."
},
"receive_strings_error": "Something went wrong generating an invoice or on-chain address.",
"error_under_min_onchain": "That's under the dust limit! On-chain transactions should be much bigger."
"error_under_min_onchain": "That's under the dust limit! On-chain transactions should be much bigger.",
"warning_on_chain_fedi": "On-chain fedimint deposits require 10 confirmations.",
"warning_address_reuse": "Only send to this address once!"
},
"send": {
"search": {

View File

@@ -168,7 +168,7 @@ function OnchainHeader(props: { info: OnChainTx; kind?: HackActivityType }) {
</Match>
</Switch>
</div>
<Show when={props.kind !== "ChannelClose"}>
<Show when={props.kind !== "ChannelClose" && Number(amount()) > 0}>
<div class="flex flex-col items-center">
<div
class="text-2xl"

View File

@@ -1,4 +1,4 @@
import { createResource, Match, Switch } from "solid-js";
import { createMemo, createResource, Match, Switch } from "solid-js";
import { InfoBox } from "~/components/InfoBox";
import { FeesModal } from "~/components/MoreInfoModal";
@@ -79,6 +79,12 @@ export function ReceiveWarnings(props: {
}
};
const onChainFedi = createMemo(() => {
if (props.flavor === "onchain" && state.federations?.length) {
return true;
}
});
return (
<Switch>
<Match when={tooSmallWarning()}>
@@ -92,6 +98,11 @@ export function ReceiveWarnings(props: {
{warningText()} <FeesModal />
</InfoBox>
</Match>
<Match when={onChainFedi()}>
<InfoBox accent="blue">
{i18n.t("receive.warning_on_chain_fedi")}
</InfoBox>
</Match>
</Switch>
);
}

View File

@@ -460,6 +460,11 @@ export function Receive() {
<p>{error()}</p>
</InfoBox>
</Show>
<Show when={flavor() === "onchain"}>
<InfoBox accent="blue">
{i18n.t("receive.warning_address_reuse")}
</InfoBox>
</Show>
<IntegratedQr
value={qrString() ?? ""}
amountSats={amount() ? amount().toString() : "0"}