Fix share extension sheets on iPad so they dont show in splits, add dismiss button

This commit is contained in:
Jackson Harper
2023-11-06 09:59:15 +08:00
parent ca801c7471
commit 553d3d9317
4 changed files with 16 additions and 2 deletions

View File

@ -53,6 +53,6 @@ public struct AddNoteSheet: View {
}, label: {
Text("Save").bold()
}))
}
}.navigationViewStyle(StackNavigationViewStyle())
}
}

View File

@ -117,6 +117,7 @@ public struct EditLabelsSheet: View {
Text("Done").bold()
}))
}
.navigationViewStyle(StackNavigationViewStyle())
.environmentObject(viewModel.services.dataService)
.task {
await labelsViewModel.loadLabelsFromStore(dataService: viewModel.services.dataService)

View File

@ -255,6 +255,19 @@ public struct ShareExtensionView: View {
HStack {
Spacer()
if UIDevice.isIPad {
Button(action: {
extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
}, label: {
Text("Dismiss")
.font(Font.system(size: 17, weight: .semibold))
.tint(Color.appGrayText)
.padding(20)
})
.frame(height: 50)
.cornerRadius(24)
.padding(.bottom, 15)
}
Button(action: {
viewModel.handleReadNowAction(extensionContext: extensionContext)
}, label: {

View File

@ -117,7 +117,7 @@ struct LinkedItemMetadataEditView: View {
)
}
}
}
}.navigationViewStyle(StackNavigationViewStyle())
}
#else
var macOSBody: some View {