fix: replace zap slider with common amount pills #296

Open
userAdityaa wants to merge 1 commits from userAdityaa/flotilla:295-zap-amount-pills into dev
Collaborator

Summary

Replaces the log-scale zap amount slider with preset amount pills in both zap modals.

Before: Zap and ZapInvoice modals used a logarithmic range slider (21–1,000,000 sats) synced bidirectionally with a number input via $effect hooks.
Screenshot 2026-06-09 at 11.30.53 AM.png

After: Common Nostr zap amounts (21, 100, 1,000, 10,000 sats) are shown as selectable pills. The number input remains for custom amounts. Default is still 21 sats.
Screenshot 2026-06-09 at 11.27.02 AM.png

Closes #295.

### Summary Replaces the log-scale zap amount slider with preset amount pills in both zap modals. **Before:** Zap and ZapInvoice modals used a logarithmic range slider (21–1,000,000 sats) synced bidirectionally with a number input via `$effect` hooks. <img width="583" alt="Screenshot 2026-06-09 at 11.30.53 AM.png" src="attachments/f0145a1b-eb26-470b-b908-6f253dbe61bd"> **After:** Common Nostr zap amounts (21, 100, 1,000, 10,000 sats) are shown as selectable pills. The number input remains for custom amounts. Default is still 21 sats. <img width="665" alt="Screenshot 2026-06-09 at 11.27.02 AM.png" src="attachments/ab65ebb2-042a-4b24-a63d-56674faf1fb4"> Closes #295.
Owner

Let's also add custom zap amounts as a setting under "wallet". Default to 21, 210, 2100, 21000, and allow the user to add/remove options.

Let's also add custom zap amounts as a setting under "wallet". Default to 21, 210, 2100, 21000, and allow the user to add/remove options.
userAdityaa force-pushed 295-zap-amount-pills from cf6380a2a6 to 954df262e7 2026-06-09 19:58:59 +00:00 Compare
Author
Collaborator

ok, added a custom zap amounts as setting under "wallet".
Screenshot 2026-06-10 at 1.28.11 AM.png

ok, added a custom zap amounts as setting under "wallet". <img width="807" alt="Screenshot 2026-06-10 at 1.28.11 AM.png" src="attachments/88bc25e4-38c0-4b95-9b78-0e54b9bf2839">
hodlbod reviewed 2026-06-09 21:03:34 +00:00
@@ -122,3 +107,2 @@
let pos = $state(minPos)
let amount = $state(minVal)
let amount = $state(zapAmounts.get()[0])
Owner

first($zapAmounts) ?? 21.

`first($zapAmounts) ?? 21`.
@@ -111,1 +111,4 @@
export const defaultZapAmounts = [21, 210, 2100, 21000]
export const zapAmounts = withGetter(writable([...defaultZapAmounts]))
Owner

Add this to defaultSettings.

Add this to defaultSettings.
@@ -81,0 +115,4 @@
if (amounts.length === 0) {
return pushToast({
theme: "error",
message: "Add at least one zap amount greater than zero.",
Owner

Separate this out into length and >0 checks so the message can be tailored to each case.

Separate this out into length and >0 checks so the message can be tailored to each case.
userAdityaa added 1 commit 2026-06-10 07:14:40 +00:00
userAdityaa force-pushed 295-zap-amount-pills from 954df262e7 to cf823be669 2026-06-10 07:14:40 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u https://gitea.coracle.social/userAdityaa/flotilla 295-zap-amount-pills:userAdityaa-295-zap-amount-pills
git checkout userAdityaa-295-zap-amount-pills
Sign in to join this conversation.