From 51dd99a62c782642cef3db8d72220c8c175c2196 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Tue, 3 Oct 2023 13:43:39 -0500 Subject: [PATCH] better warnings default --- src/components/AmountCard.tsx | 10 +++++++--- src/components/AmountEditable.tsx | 4 ++-- src/components/NWCBudgetEditor.tsx | 2 +- src/routes/Receive.tsx | 1 + src/routes/Send.tsx | 1 - src/routes/Swap.tsx | 1 - 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/AmountCard.tsx b/src/components/AmountCard.tsx index 71d8909..4af7287 100644 --- a/src/components/AmountCard.tsx +++ b/src/components/AmountCard.tsx @@ -76,7 +76,7 @@ export function AmountCard(props: { initialOpen?: boolean; isAmountEditable?: boolean; setAmountSats?: (amount: bigint) => void; - skipWarnings?: boolean; + showWarnings?: boolean; exitRoute?: string; maxAmountSats?: bigint; }) { @@ -116,7 +116,9 @@ export function AmountCard(props: { ? props.setAmountSats : noop } - skipWarnings={props.skipWarnings} + showWarnings={ + props.showWarnings ?? false + } exitRoute={props.exitRoute} maxAmountSats={props.maxAmountSats} fee={props.fee} @@ -185,7 +187,9 @@ export function AmountCard(props: { ? props.setAmountSats : noop } - skipWarnings={props.skipWarnings} + showWarnings={ + props.showWarnings ?? false + } exitRoute={props.exitRoute} maxAmountSats={props.maxAmountSats} fee={props.fee} diff --git a/src/components/AmountEditable.tsx b/src/components/AmountEditable.tsx index facf12b..d1940a6 100644 --- a/src/components/AmountEditable.tsx +++ b/src/components/AmountEditable.tsx @@ -262,7 +262,7 @@ export const AmountEditable: ParentComponent<{ initialAmountSats: string; initialOpen: boolean; setAmountSats: (s: bigint) => void; - skipWarnings?: boolean; + showWarnings: boolean; exitRoute?: string; maxAmountSats?: bigint; fee?: string; @@ -781,7 +781,7 @@ export const AmountEditable: ParentComponent<{ {warningText()} diff --git a/src/components/NWCBudgetEditor.tsx b/src/components/NWCBudgetEditor.tsx index ee20567..555068d 100644 --- a/src/components/NWCBudgetEditor.tsx +++ b/src/components/NWCBudgetEditor.tsx @@ -109,11 +109,11 @@ export function NWCBudgetEditor(props: { {(field, _fieldProps) => (
{ setValue( budgetForm, diff --git a/src/routes/Receive.tsx b/src/routes/Receive.tsx index 685907d..1ae30dc 100644 --- a/src/routes/Receive.tsx +++ b/src/routes/Receive.tsx @@ -386,6 +386,7 @@ export default function Receive() { setAmountSats={setAmount} isAmountEditable exitRoute={amount() ? "/receive" : "/"} + showWarnings /> diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index 3128507..98ae8c9 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -700,7 +700,6 @@ export default function Send() { fee={feeEstimate()?.toString()} isAmountEditable={isAmtEditable()} maxAmountSats={maxAmountSats()} - skipWarnings={true} /> diff --git a/src/routes/Swap.tsx b/src/routes/Swap.tsx index 7367cf4..b26d5c8 100644 --- a/src/routes/Swap.tsx +++ b/src/routes/Swap.tsx @@ -435,7 +435,6 @@ export default function Swap() { setAmountSats={setAmountSats} fee={feeEstimate()?.toString()} isAmountEditable={true} - skipWarnings={true} maxAmountSats={maxOnchain()} /> 0n}>