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:
@@ -96,7 +96,7 @@ struct FullScreenCarouselView<Content: View>: View {
|
||||
GeometryReader { geo in
|
||||
VStack {
|
||||
if showMenu {
|
||||
NavDismissBarView(showBackgroundCircle: false)
|
||||
NavDismissBarView(navDismissBarContainer: .fullScreenCarousel)
|
||||
.foregroundColor(.white)
|
||||
Spacer()
|
||||
|
||||
|
||||
@@ -40,13 +40,18 @@ struct ProfileImageContainerView: View {
|
||||
}
|
||||
}
|
||||
|
||||
enum NavDismissBarContainer {
|
||||
case fullScreenCarousel
|
||||
case profilePicImageView
|
||||
}
|
||||
|
||||
struct NavDismissBarView: View {
|
||||
|
||||
@Environment(\.presentationMode) var presentationMode
|
||||
let showBackgroundCircle: Bool
|
||||
let navDismissBarContainer: NavDismissBarContainer
|
||||
|
||||
init(showBackgroundCircle: Bool = true) {
|
||||
self.showBackgroundCircle = showBackgroundCircle
|
||||
init(navDismissBarContainer: NavDismissBarContainer) {
|
||||
self.navDismissBarContainer = navDismissBarContainer
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -54,15 +59,17 @@ struct NavDismissBarView: View {
|
||||
Button(action: {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}, label: {
|
||||
if showBackgroundCircle {
|
||||
if case .profilePicImageView = navDismissBarContainer {
|
||||
Image("close")
|
||||
.frame(width: 33, height: 33)
|
||||
.background(.regularMaterial)
|
||||
.clipShape(Circle())
|
||||
}
|
||||
else {
|
||||
else if case .fullScreenCarousel = navDismissBarContainer {
|
||||
Image("close")
|
||||
.frame(width: 33, height: 33)
|
||||
.background(.damusBlack)
|
||||
.clipShape(Circle())
|
||||
}
|
||||
})
|
||||
|
||||
@@ -96,7 +103,7 @@ struct ProfilePicImageView: View {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}))
|
||||
}
|
||||
.overlay(NavDismissBarView(), alignment: .top)
|
||||
.overlay(NavDismissBarView(navDismissBarContainer: .profilePicImageView), alignment: .top)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user