damus

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

commit b0aac1fc424740c82e39930cf60082b55058db0c
parent 72b51a81deba4dffd4bbba64a8fba553da3bb99b
Author: OlegAba <mail@olegaba.com>
Date:   Wed, 29 Mar 2023 19:02:00 -0400

Fix unclickable image dismiss button

Changelog-Fixed: Fix unclickable image dismiss button
Closes: #833

Diffstat:
Mdamus/Views/Images/ImageView.swift | 22+---------------------
Mdamus/Views/Images/ProfilePicImageView.swift | 17+++++++++++------
Mdamus/Views/Profile/ProfileView.swift | 2+-
3 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/damus/Views/Images/ImageView.swift b/damus/Views/Images/ImageView.swift @@ -16,26 +16,6 @@ struct ImageView: View { @State private var selectedIndex = 0 @State var showMenu = true - var navBarView: some View { - VStack { - HStack { - /* - Text(urls[selectedIndex]?.lastPathComponent ?? "") - .bold() - */ - - Spacer() - - Button(action: { - presentationMode.wrappedValue.dismiss() - }, label: { - Image(systemName: "xmark") - }) - } - .padding() - } - } - var tabViewIndicator: some View { HStack(spacing: 10) { ForEach(urls.indices, id: \.self) { index in @@ -80,7 +60,7 @@ struct ImageView: View { .overlay( VStack { if showMenu { - navBarView + NavDismissBarView() Spacer() if (urls.count > 1) { diff --git a/damus/Views/Images/ProfilePicImageView.swift b/damus/Views/Images/ProfilePicImageView.swift @@ -39,14 +39,11 @@ struct ProfileImageContainerView: View { } } -struct ProfilePicImageView: View { - - let pubkey: String - let profiles: Profiles +struct NavDismissBarView: View { @Environment(\.presentationMode) var presentationMode - var navBarView: some View { + var body: some View { HStack { Button(action: { presentationMode.wrappedValue.dismiss() @@ -61,6 +58,14 @@ struct ProfilePicImageView: View { } .padding() } +} + +struct ProfilePicImageView: View { + + let pubkey: String + let profiles: Profiles + + @Environment(\.presentationMode) var presentationMode var body: some View { ZStack { @@ -79,7 +84,7 @@ struct ProfilePicImageView: View { presentationMode.wrappedValue.dismiss() })) } - .overlay(navBarView, alignment: .top) + .overlay(NavDismissBarView(), alignment: .top) } } diff --git a/damus/Views/Profile/ProfileView.swift b/damus/Views/Profile/ProfileView.swift @@ -323,7 +323,7 @@ struct ProfileView: View { is_zoomed.toggle() } .fullScreenCover(isPresented: $is_zoomed) { - ProfileZoomView(pubkey: profile.pubkey, profiles: damus_state.profiles) } + ProfilePicImageView(pubkey: profile.pubkey, profiles: damus_state.profiles) } Spacer()