fix: replace zap slider with common amount pills

This commit is contained in:
2026-06-09 11:29:18 +05:30
committed by hodlbod
parent 7bfbb17479
commit f712585178
4 changed files with 142 additions and 82 deletions
+4
View File
@@ -37,6 +37,7 @@ export type SettingsValues = {
send_delay: number
font_size: number
alerts: SpaceNotificationSettings[]
zap_amounts: number[]
}
export type Settings = {
@@ -54,6 +55,7 @@ export const defaultSettings: SettingsValues = {
send_delay: 0,
font_size: 1.1,
alerts: [],
zap_amounts: [21, 210, 2100, 21000],
}
export const settingsByPubkey = deriveItemsByKey({
@@ -80,6 +82,8 @@ export const loadUserSettings = makeUserLoader(loadSettings)
export const userSettingsValues = derived(userSettings, $s => $s?.values || defaultSettings)
export const zapAmounts = derived(userSettingsValues, $settings => $settings.zap_amounts)
export const getSettings = getter(userSettingsValues)
export const getSetting = <T>(key: keyof Settings["values"]) => getSettings()[key] as T