Add OnlyZaps Mode

Changelog-Added: Add OnlyZaps mode: disable reactions, only zaps!
This commit is contained in:
William Casarin
2023-04-20 13:40:37 -07:00
parent 209f3e8759
commit ac82f1bc09
16 changed files with 107 additions and 75 deletions

View File

@@ -46,6 +46,18 @@ struct EventActionBar: View {
test_lnurl ?? damus_state.profiles.lookup(id: event.pubkey)?.lnurl
}
var show_like: Bool {
if settings.onlyzaps_mode {
return false
}
guard let profile = damus_state.profiles.lookup(id: event.pubkey) else {
return true
}
return profile.reactions ?? true
}
var body: some View {
HStack {
if damus_state.keypair.privkey != nil {
@@ -75,7 +87,7 @@ struct EventActionBar: View {
.foregroundColor(bar.boosted ? Color.green : Color.gray)
}
if !settings.hide_reactions {
if show_like {
Spacer()
HStack(spacing: 4) {

View File

@@ -32,7 +32,7 @@ struct EventDetailBar: View {
.buttonStyle(PlainButtonStyle())
}
if bar.likes > 0 && !state.settings.hide_reactions {
if bar.likes > 0 && !state.settings.onlyzaps_mode {
NavigationLink(destination: ReactionsView(damus_state: state, model: ReactionsModel(state: state, target: target))) {
let noun = Text(verbatim: "\(reactionsCountString(bar.likes))").foregroundColor(.gray)
Text("\(Text("\(bar.likes)").font(.body.bold())) \(noun)", comment: "Sentence composed of 2 variables to describe how many reactions there are on a post. In source English, the first variable is the number of reactions, and the second variable is 'Reaction' or 'Reactions'.")