Use long-press gesture for custom zaps
Changelog-Changed: Use long-press for custom zaps
This commit is contained in:
@@ -68,24 +68,28 @@ struct ZapButton: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Image(systemName: zap_img)
|
Button(action: {
|
||||||
.foregroundColor(zap_color == nil ? Color.gray : zap_color!)
|
}, label: {
|
||||||
.font(.footnote.weight(.medium))
|
Image(systemName: zap_img)
|
||||||
.onTapGesture {
|
.foregroundColor(zap_color == nil ? Color.gray : zap_color!)
|
||||||
if bar.zapped {
|
.font(.footnote.weight(.medium))
|
||||||
//notify(.delete, bar.our_tip)
|
})
|
||||||
} else if !zapping {
|
.simultaneousGesture(LongPressGesture().onEnded {_ in
|
||||||
self.showing_zap_customizer = true
|
guard !zapping else {
|
||||||
//send_zap(damus_state: damus_state, event: event, lnurl: lnurl, is_custom: false)
|
return
|
||||||
//self.zapping = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.onLongPressGesture(minimumDuration: 0, pressing: { is_charing in
|
|
||||||
self.is_charging = is_charging
|
self.showing_zap_customizer = true
|
||||||
}, perform: {
|
})
|
||||||
self.showing_zap_customizer = true
|
.simultaneousGesture(TapGesture().onEnded {_ in
|
||||||
})
|
guard !zapping else {
|
||||||
.accessibilityLabel(NSLocalizedString("Zap", comment: "Accessibility label for zap button"))
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
send_zap(damus_state: damus_state, event: event, lnurl: lnurl, is_custom: false, comment: nil, amount_sats: nil, zap_type: ZapType.pub)
|
||||||
|
self.zapping = true
|
||||||
|
})
|
||||||
|
.accessibilityLabel(NSLocalizedString("Zap", comment: "Accessibility label for zap button"))
|
||||||
|
|
||||||
if bar.zap_total > 0 {
|
if bar.zap_total > 0 {
|
||||||
Text(verbatim: format_msats_abbrev(bar.zap_total))
|
Text(verbatim: format_msats_abbrev(bar.zap_total))
|
||||||
|
|||||||
Reference in New Issue
Block a user