better warnings default

This commit is contained in:
Paul Miller
2023-10-03 13:43:39 -05:00
committed by Tony Giorgio
parent f5ce8e2c33
commit 51dd99a62c
6 changed files with 11 additions and 8 deletions

View File

@@ -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}

View File

@@ -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<{
</InfoBox>
</Match>
<Match
when={warningText() && !props.skipWarnings}
when={warningText() && props.showWarnings}
>
<InfoBox accent="blue">
{warningText()} <FeesModal />

View File

@@ -109,11 +109,11 @@ export function NWCBudgetEditor(props: {
{(field, _fieldProps) => (
<div class="flex flex-col items-end gap-2">
<AmountEditable
skipWarnings={true}
initialOpen={false}
initialAmountSats={
field.value || "0"
}
showWarnings={false}
setAmountSats={(a) => {
setValue(
budgetForm,

View File

@@ -386,6 +386,7 @@ export default function Receive() {
setAmountSats={setAmount}
isAmountEditable
exitRoute={amount() ? "/receive" : "/"}
showWarnings
/>
<Card title={i18n.t("common.private_tags")}>

View File

@@ -700,7 +700,6 @@ export default function Send() {
fee={feeEstimate()?.toString()}
isAmountEditable={isAmtEditable()}
maxAmountSats={maxAmountSats()}
skipWarnings={true}
/>
</Match>
<Match when={true}>

View File

@@ -435,7 +435,6 @@ export default function Swap() {
setAmountSats={setAmountSats}
fee={feeEstimate()?.toString()}
isAmountEditable={true}
skipWarnings={true}
maxAmountSats={maxOnchain()}
/>
<Show when={amountWarning() && amountSats() > 0n}>