Apply non-pure black dark mode to Drafts screen
This commit is contained in:
parent
74d8adfffe
commit
6e2f6bb8e9
|
@ -128,7 +128,7 @@ struct ComposeView: View {
|
|||
}
|
||||
})
|
||||
.sheet(isPresented: $uiState.isShowingDraftsList) {
|
||||
DraftsView(currentDraft: draft, mastodonController: mastodonController)
|
||||
DraftsRepresentable(currentDraft: draft, mastodonController: mastodonController)
|
||||
}
|
||||
.actionSheet(isPresented: $uiState.isShowingSaveDraftSheet, content: self.saveAndCloseSheet)
|
||||
.alert(isPresented: $isShowingPostErrorAlert) {
|
||||
|
|
|
@ -8,6 +8,21 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS, obsoleted: 16.0)
|
||||
struct DraftsRepresentable: UIViewControllerRepresentable {
|
||||
typealias UIViewControllerType = UIHostingController<DraftsView>
|
||||
|
||||
let currentDraft: Draft
|
||||
let mastodonController: MastodonController
|
||||
|
||||
func makeUIViewController(context: Context) -> UIHostingController<DraftsView> {
|
||||
return UIHostingController(rootView: DraftsView(currentDraft: currentDraft, mastodonController: mastodonController))
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: UIHostingController<DraftsView>, context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
struct DraftsView: View {
|
||||
let currentDraft: Draft
|
||||
// don't pass this in via the environment b/c it crashes on macOS (at least, in Designed for iPad mode) since the environment doesn't get propagated through the modal popup window or something
|
||||
|
@ -49,8 +64,10 @@ struct DraftsView: View {
|
|||
.map { visibleDrafts[$0] }
|
||||
.forEach { draftsManager.remove($0) }
|
||||
}
|
||||
.appGroupedListRowBackground()
|
||||
}
|
||||
.listStyle(.plain)
|
||||
.appGroupedListBackground(container: DraftsRepresentable.UIViewControllerType.self)
|
||||
.navigationTitle(Text("Drafts"))
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
|
|
Loading…
Reference in New Issue