Move share and report actions into a ... button
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user