damus

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

commit 7d323b65e47867e4d8209490b1b54ae79c3ac6f7
parent b69116e68571185102b75ccde625b7d6792cf759
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 25 Jan 2023 08:41:05 -0800

Move share and report actions into a ... button

Diffstat:
Mdamus/Views/ProfileView.swift | 23+++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/damus/Views/ProfileView.swift b/damus/Views/ProfileView.swift @@ -114,6 +114,7 @@ struct ProfileView: View { @State var showing_select_wallet: Bool = false @State var is_zoomed: Bool = false @State var show_share_sheet: Bool = false + @State var action_sheet_presented: Bool = false @StateObject var user_settings = UserSettingsStore() @Environment(\.dismiss) var dismiss @@ -166,6 +167,15 @@ struct ProfileView: View { static let markdown = Markdown() + var ActionSheetButton: some View { + Button(action: { + action_sheet_presented = true + }) { + Image(systemName: "ellipsis.circle") + .profile_button_style(scheme: colorScheme) + } + } + var ShareButton: some View { Button(action: { show_share_sheet = true @@ -238,6 +248,7 @@ struct ProfileView: View { Spacer() Group { + ActionSheetButton if let profile = data { if let lnurl = profile.lnurl, lnurl != "" { @@ -247,8 +258,6 @@ struct ProfileView: View { DMButton - ShareButton - if profile.pubkey != damus_state.pubkey { FollowButtonView( target: profile.get_follow_target(), @@ -365,6 +374,16 @@ struct ProfileView: View { } } } + .confirmationDialog("Actions", isPresented: $action_sheet_presented) { + Button("Share") { + show_share_sheet = true + } + + Button("Report") { + let target: ReportTarget = .user(profile.pubkey) + notify(.report, target) + } + } .ignoresSafeArea() } }