mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Move toolbar from ContentView to PostLIstView
This commit is contained in:
parent
c4e9089e76
commit
0b0fdd81a1
@ -53,25 +53,6 @@ struct ContentView: View {
|
||||
#if os(macOS)
|
||||
ZStack {
|
||||
PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .primaryAction) {
|
||||
if let selectedPost = model.selectedPost {
|
||||
ActivePostToolbarView(activePost: selectedPost)
|
||||
.alert(isPresented: $model.isPresentingNetworkErrorAlert, content: {
|
||||
Alert(
|
||||
title: Text("Connection Error"),
|
||||
message: Text("""
|
||||
There is no internet connection at the moment. \
|
||||
Please reconnect or try again later.
|
||||
"""),
|
||||
dismissButton: .default(Text("OK"), action: {
|
||||
model.isPresentingNetworkErrorAlert = false
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
if model.isProcessingRequest {
|
||||
ZStack {
|
||||
Color(NSColor.controlBackgroundColor).opacity(0.75)
|
||||
|
@ -84,6 +84,25 @@ struct PostListView: View {
|
||||
showAllPosts: showAllPosts,
|
||||
postCount: $postCount
|
||||
)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .primaryAction) {
|
||||
if let selectedPost = model.selectedPost {
|
||||
ActivePostToolbarView(activePost: selectedPost)
|
||||
.alert(isPresented: $model.isPresentingNetworkErrorAlert, content: {
|
||||
Alert(
|
||||
title: Text("Connection Error"),
|
||||
message: Text("""
|
||||
There is no internet connection at the moment. \
|
||||
Please reconnect or try again later.
|
||||
"""),
|
||||
dismissButton: .default(Text("OK"), action: {
|
||||
model.isPresentingNetworkErrorAlert = false
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
.onDisappear {
|
||||
DispatchQueue.main.async {
|
||||
self.model.selectedCollection = nil
|
||||
|
Loading…
Reference in New Issue
Block a user