Feat: Adds wallet icon/color select (#2917)

This commit is contained in:
Arc
2025-02-04 15:03:35 +02:00
committed by GitHub
parent dd9b217fdf
commit 960c58db87
10 changed files with 205 additions and 63 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -216,7 +216,8 @@ window.LNbits = {
name: data.name,
adminkey: data.adminkey,
inkey: data.inkey,
currency: data.currency
currency: data.currency,
extra: data.extra
}
newWallet.msat = data.balance_msat
newWallet.sat = Math.floor(data.balance_msat / 1000)
+66
View File
@@ -44,6 +44,62 @@ window.WalletPageLogic = {
show: false,
location: window.location
},
icon: {
show: false,
data: {},
colorOptions: [
'primary',
'purple',
'orange',
'green',
'brown',
'blue',
'red',
'pink'
],
options: [
'home',
'star',
'bolt',
'paid',
'savings',
'store',
'videocam',
'music_note',
'flight',
'train',
'directions_car',
'school',
'construction',
'science',
'sports_esports',
'sports_tennis',
'theaters',
'water',
'headset_mic',
'videogame_asset',
'person',
'group',
'pets',
'sunny',
'elderly',
'verified',
'snooze',
'mail',
'forum',
'shopping_cart',
'shopping_bag',
'attach_money',
'print_connect',
'dark_mode',
'light_mode',
'android',
'network_wifi',
'shield',
'fitness_center',
'lunch_dining'
]
},
update: {
name: null,
currency: null
@@ -149,6 +205,16 @@ window.WalletPageLogic = {
handleBalanceUpdate(value) {
this.g.wallet.sat = this.g.wallet.sat + value
},
setSelectedIcon(selectedIcon) {
this.icon.data.icon = selectedIcon
},
setSelectedColor(selectedColor) {
this.icon.data.color = selectedColor
},
setIcon() {
this.updateWallet(this.icon.data)
this.icon.show = false
},
createInvoice() {
this.receive.status = 'loading'
if (LNBITS_DENOMINATION != 'sats') {