Skip to content

Commit

Permalink
debugRevenueCatOverlay: ability to close on macOS/Catalyst
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Jun 14, 2023
1 parent 7e9a1b6 commit 4168309
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/Support/DebugUI/DebugContentViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ struct DebugSwiftUIRootView: View {
@StateObject
private var model = DebugViewModel()

@Environment(\.presentationMode)
private var presentationMode

var body: some View {
NavigationStack(path: self.$model.navigationPath) {
DebugSummaryView(model: self.model)
Expand All @@ -39,6 +42,17 @@ struct DebugSwiftUIRootView: View {
.foregroundStyle(Material.thinMaterial)
.edgesIgnoringSafeArea(.all)
)
#if os(macOS) || targetEnvironment(macCatalyst)
.toolbar {
ToolbarItem(placement: .automatic) {
Button {
self.presentationMode.wrappedValue.dismiss()
} label: {
Label("Close", systemImage: "xmark")
}
}
}
#endif
}
.task {
await self.model.load()
Expand Down

0 comments on commit 4168309

Please sign in to comment.