200k sat warning

This commit is contained in:
Paul Miller
2024-03-27 12:09:58 -05:00
committed by Tony Giorgio
parent 71e53bfe43
commit 9bd968b051
5 changed files with 48 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ function SmallSubtleAmount(props: {
return (
<h2
class="flex flex-row items-center whitespace-nowrap text-xl font-light text-neutral-400"
class="flex flex-row items-center whitespace-nowrap text-xl font-light text-m-grey-350"
tabIndex={0}
>
<Show when={!props.loading || props.mode === "fiat"} fallback="…">

View File

@@ -11,7 +11,7 @@ const AmountKeyValue: ParentComponent<{ key: string; gray?: boolean }> = (
return (
<div
class="flex items-center justify-between"
classList={{ "text-neutral-400": props.gray }}
classList={{ "text-m-grey-350": props.gray }}
>
<div class="font-semibold uppercase">{props.key}</div>
<div class="font-light">{props.children}</div>

View File

@@ -160,7 +160,7 @@ const FullscreenLoader = () => {
<div class="flex w-full flex-col items-center justify-center gap-4 h-device">
<LoadingSpinner wide />
<Show when={waitedTooLong()}>
<p class="max-w-[20rem] text-neutral-400">
<p class="max-w-[20rem] text-m-grey-350">
{i18n.t("error.load_time.stuck")}{" "}
<A class="text-white" href="/settings/emergencykit">
{i18n.t("error.emergency_link")}
@@ -266,7 +266,7 @@ export const NiceP: ParentComponent = (props) => {
};
export const TinyText: ParentComponent = (props) => {
return <p class="text-sm text-neutral-400">{props.children}</p>;
return <p class="text-sm text-m-grey-350">{props.children}</p>;
};
export const TinyButton: ParentComponent<{

View File

@@ -3,7 +3,7 @@ import {
MutinyInvoice
} from "@mutinywallet/mutiny-wasm";
import { useNavigate } from "@solidjs/router";
import { ArrowLeftRight } from "lucide-solid";
import { ArrowLeftRight, CircleHelp, Users, Zap } from "lucide-solid";
import {
createEffect,
createMemo,
@@ -102,6 +102,33 @@ function FeeWarning(props: { fee: bigint; flavor: ReceiveFlavor }) {
);
}
function ReceiveMethodHelp(props: { amountSats: bigint }) {
const i18n = useI18n();
const [open, setOpen] = createSignal(false);
return (
<>
<button class="flex gap-2 self-end" onClick={() => setOpen(true)}>
<Switch>
<Match when={props.amountSats < 200000n}>
<Users class="w-[18px]" />
</Match>
<Match when={true}>
<Zap class="w-[18px]" />
</Match>
</Switch>
<CircleHelp class="w-[18px] text-m-grey-350" />
</button>
<SimpleDialog
open={open()}
setOpen={setOpen}
title={i18n.t("receive.method_help.title")}
>
<p>{i18n.t("receive.method_help.body")}</p>
</SimpleDialog>
</>
);
}
export function Receive() {
const [state, actions] = useMegaStore();
const navigate = useNavigate();
@@ -382,6 +409,16 @@ export function Receive() {
</VStack>
<div class="flex-1" />
<VStack>
<Show
when={
state.federations &&
state.federations.length
}
>
<ReceiveMethodHelp
amountSats={amount() || 0n}
/>
</Show>
<form onSubmit={onSubmit}>
<SimpleInput
type="text"
@@ -414,7 +451,7 @@ export function Receive() {
amountSats={amount() ? amount().toString() : "0"}
kind={flavor()}
/>
<p class="text-center text-neutral-400">
<p class="text-center text-m-grey-350">
{i18n.t("receive.keep_mutiny_open")}
</p>
{/* Only show method chooser when we have an invoice */}