nozaps: restore zap button with zap info, just make it not clickable
This commit is contained in:
@@ -38,10 +38,6 @@ struct ZapButton: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var zap_img: String {
|
var zap_img: String {
|
||||||
if damus_state.settings.nozaps {
|
|
||||||
return "zap"
|
|
||||||
}
|
|
||||||
|
|
||||||
switch our_zap {
|
switch our_zap {
|
||||||
case .none:
|
case .none:
|
||||||
return "zap"
|
return "zap"
|
||||||
@@ -53,10 +49,6 @@ struct ZapButton: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var zap_color: Color {
|
var zap_color: Color {
|
||||||
if damus_state.settings.nozaps {
|
|
||||||
return Color.gray
|
|
||||||
}
|
|
||||||
|
|
||||||
if our_zap == nil {
|
if our_zap == nil {
|
||||||
return Color.gray
|
return Color.gray
|
||||||
}
|
}
|
||||||
@@ -114,17 +106,17 @@ struct ZapButton: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Button(action: {
|
|
||||||
}, label: {
|
|
||||||
Image(zap_img)
|
|
||||||
.resizable()
|
|
||||||
.foregroundColor(zap_color)
|
|
||||||
.font(.footnote.weight(.medium))
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width:20, height: 20)
|
|
||||||
})
|
|
||||||
|
|
||||||
if zaps.zap_total > 0 {
|
if zaps.zap_total > 0 {
|
||||||
|
Button(action: {
|
||||||
|
}, label: {
|
||||||
|
Image(zap_img)
|
||||||
|
.resizable()
|
||||||
|
.foregroundColor(zap_color)
|
||||||
|
.font(.footnote.weight(.medium))
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width:20, height: 20)
|
||||||
|
})
|
||||||
|
|
||||||
Text(verbatim: format_msats_abbrev(zaps.zap_total))
|
Text(verbatim: format_msats_abbrev(zaps.zap_total))
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(zap_color)
|
.foregroundColor(zap_color)
|
||||||
@@ -134,7 +126,7 @@ struct ZapButton: View {
|
|||||||
.simultaneousGesture(LongPressGesture().onEnded {_ in
|
.simultaneousGesture(LongPressGesture().onEnded {_ in
|
||||||
// when we don't have nozaps mode enable, long press shows the zap customizer
|
// when we don't have nozaps mode enable, long press shows the zap customizer
|
||||||
if !damus_state.settings.nozaps {
|
if !damus_state.settings.nozaps {
|
||||||
present_sheet(.zap(target: target, lnurl: lnurl))
|
//present_sheet(.zap(target: target, lnurl: lnurl))
|
||||||
}
|
}
|
||||||
|
|
||||||
// long press does nothing in nozaps mode
|
// long press does nothing in nozaps mode
|
||||||
@@ -142,7 +134,7 @@ struct ZapButton: View {
|
|||||||
.highPriorityGesture(TapGesture().onEnded {
|
.highPriorityGesture(TapGesture().onEnded {
|
||||||
// when we have appstore mode on, only show the zap customizer as "user zaps"
|
// when we have appstore mode on, only show the zap customizer as "user zaps"
|
||||||
if damus_state.settings.nozaps {
|
if damus_state.settings.nozaps {
|
||||||
present_sheet(.zap(target: target, lnurl: lnurl))
|
//present_sheet(.zap(target: target, lnurl: lnurl))
|
||||||
} else {
|
} else {
|
||||||
// otherwise we restore the original behavior of one-tap zaps
|
// otherwise we restore the original behavior of one-tap zaps
|
||||||
tap()
|
tap()
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ struct EventActionBar: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !damus_state.settings.nozaps, let lnurl = self.lnurl {
|
if let lnurl = self.lnurl {
|
||||||
Spacer()
|
Spacer()
|
||||||
ZapButton(damus_state: damus_state, target: ZapTarget.note(id: event.id, author: event.pubkey), lnurl: lnurl, zaps: self.damus_state.events.get_cache_data(self.event.id).zaps_model)
|
ZapButton(damus_state: damus_state, target: ZapTarget.note(id: event.id, author: event.pubkey), lnurl: lnurl, zaps: self.damus_state.events.get_cache_data(self.event.id).zaps_model)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user