diff --git a/src/assets/icons/gift.svg b/src/assets/icons/gift.svg new file mode 100644 index 00000000..5885882f --- /dev/null +++ b/src/assets/icons/gift.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/treasure-closed.png b/src/assets/treasure-closed.png new file mode 100644 index 00000000..2f458c84 Binary files /dev/null and b/src/assets/treasure-closed.png differ diff --git a/src/assets/treasure.gif b/src/assets/treasure.gif new file mode 100644 index 00000000..ddc039c9 Binary files /dev/null and b/src/assets/treasure.gif differ diff --git a/src/components/AmountCard.tsx b/src/components/AmountCard.tsx index 71d89098..4af7287f 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 820edaeb..d1940a6d 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; @@ -564,7 +564,8 @@ export const AmountEditable: ParentComponent<{ } } - function handleClose() { + function handleClose(e: SubmitEvent | MouseEvent | KeyboardEvent) { + e.preventDefault(); props.setAmountSats(BigInt(props.initialAmountSats)); setIsOpen(false); setLocalSats(props.initialAmountSats); @@ -576,6 +577,7 @@ export const AmountEditable: ParentComponent<{ ) ); props.exitRoute && navigate(props.exitRoute); + return false; } // What we're all here for in the first place: returning a value @@ -586,6 +588,7 @@ export const AmountEditable: ParentComponent<{ satsToFiat(state.price, Number(localSats()) || 0, state.fiat) ); setIsOpen(false); + return false; } function handleSatsInput(e: InputEvent) { @@ -706,6 +709,7 @@ export const AmountEditable: ParentComponent<{