Fix: dismiss button in full screen carousel

This updates the dismiss button on the fullscreen carousel
so that it is more visible in some scenarios.

Changelog-Fixed: Fix dismiss button visibility
Signed-off-by: Swift Coder <scoder1747@gmail.com>
This commit is contained in:
Swift Coder
2024-10-23 11:13:27 -04:00
parent 4effaa4324
commit 8a2dbc95ca
2 changed files with 14 additions and 7 deletions

View File

@@ -96,7 +96,7 @@ struct FullScreenCarouselView<Content: View>: View {
GeometryReader { geo in GeometryReader { geo in
VStack { VStack {
if showMenu { if showMenu {
NavDismissBarView(showBackgroundCircle: false) NavDismissBarView(navDismissBarContainer: .fullScreenCarousel)
.foregroundColor(.white) .foregroundColor(.white)
Spacer() Spacer()

View File

@@ -40,13 +40,18 @@ struct ProfileImageContainerView: View {
} }
} }
enum NavDismissBarContainer {
case fullScreenCarousel
case profilePicImageView
}
struct NavDismissBarView: View { struct NavDismissBarView: View {
@Environment(\.presentationMode) var presentationMode @Environment(\.presentationMode) var presentationMode
let showBackgroundCircle: Bool let navDismissBarContainer: NavDismissBarContainer
init(showBackgroundCircle: Bool = true) { init(navDismissBarContainer: NavDismissBarContainer) {
self.showBackgroundCircle = showBackgroundCircle self.navDismissBarContainer = navDismissBarContainer
} }
var body: some View { var body: some View {
@@ -54,15 +59,17 @@ struct NavDismissBarView: View {
Button(action: { Button(action: {
presentationMode.wrappedValue.dismiss() presentationMode.wrappedValue.dismiss()
}, label: { }, label: {
if showBackgroundCircle { if case .profilePicImageView = navDismissBarContainer {
Image("close") Image("close")
.frame(width: 33, height: 33) .frame(width: 33, height: 33)
.background(.regularMaterial) .background(.regularMaterial)
.clipShape(Circle()) .clipShape(Circle())
} }
else { else if case .fullScreenCarousel = navDismissBarContainer {
Image("close") Image("close")
.frame(width: 33, height: 33) .frame(width: 33, height: 33)
.background(.damusBlack)
.clipShape(Circle())
} }
}) })
@@ -96,7 +103,7 @@ struct ProfilePicImageView: View {
presentationMode.wrappedValue.dismiss() presentationMode.wrappedValue.dismiss()
})) }))
} }
.overlay(NavDismissBarView(), alignment: .top) .overlay(NavDismissBarView(navDismissBarContainer: .profilePicImageView), alignment: .top)
} }
} }