damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 7f00ef5d9d61be9b968862bb9e93bcf4c561e1d6
parent d66315594137b5478909d3e8c751348d7405860f
Author: chungwwei <39935368+chungwwei@users.noreply.github.com>
Date:   Wed, 21 Aug 2024 19:25:29 -0400

Add mute button to ProfileActionSheet

This PR adds mute button to ProfileActionSheet, allowing user to quick mute npubs/bots

Changelog-Added: Added mute button to ProfileActionSheet
Signed-off-by: chungwwei <chungwwei223@gmail.com>
Diffstat:
Mdamus/Views/ProfileActionSheetView.swift | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/damus/Views/ProfileActionSheetView.swift b/damus/Views/ProfileActionSheetView.swift @@ -45,6 +45,21 @@ struct ProfileActionSheetView: View { ) } + var muteButton: some View { + let target_pubkey = self.profile.pubkey + return VStack(alignment: .center, spacing: 10) { + MuteDurationMenu { duration in + notify(.mute(.user(target_pubkey, duration?.date_from_now))) + } label: { + Image("mute") + } + .buttonStyle(NeutralButtonShape.circle.style) + Text("Mute", comment: "Button label that allows the user to mute the user shown on-screen") + .foregroundStyle(.secondary) + .font(.caption) + } + } + var dmButton: some View { let dm_model = damus_state.dms.lookup_or_create(profile.pubkey) return VStack(alignment: .center, spacing: 10) { @@ -103,6 +118,9 @@ struct ProfileActionSheetView: View { self.followButton self.zapButton self.dmButton + if damus_state.keypair.pubkey != profile.pubkey && damus_state.keypair.privkey != nil { + self.muteButton + } } .padding()