Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10494226
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
View Options
diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift
index aba7984..6422683 100644
--- a/Shared/Navigation/ContentView.swift
+++ b/Shared/Navigation/ContentView.swift
@@ -1,24 +1,26 @@
import SwiftUI
struct ContentView: View {
@EnvironmentObject var model: WriteFreelyModel
var body: some View {
NavigationView {
SidebarView()
PostListView(selectedCollection: allPostsCollection)
Text("Select a post, or create a new draft.")
.foregroundColor(.secondary)
}
.environmentObject(model)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
- ContentView()
- .environmentObject(WriteFreelyModel())
+ let model = WriteFreelyModel()
+ model.collections = CollectionListModel(with: [userCollection1, userCollection2, userCollection3])
+ return ContentView()
+ .environmentObject(model)
}
}
diff --git a/Shared/Navigation/SidebarView.swift b/Shared/Navigation/SidebarView.swift
index 41d67d7..a95ee08 100644
--- a/Shared/Navigation/SidebarView.swift
+++ b/Shared/Navigation/SidebarView.swift
@@ -1,13 +1,16 @@
import SwiftUI
struct SidebarView: View {
var body: some View {
CollectionListView()
}
}
struct SidebarView_Previews: PreviewProvider {
static var previews: some View {
- SidebarView()
+ let model = WriteFreelyModel()
+ model.collections = CollectionListModel(with: [userCollection1, userCollection2, userCollection3])
+ return SidebarView()
+ .environmentObject(model)
}
}
diff --git a/Shared/PostCollection/CollectionListView.swift b/Shared/PostCollection/CollectionListView.swift
index ce478fe..1e06865 100644
--- a/Shared/PostCollection/CollectionListView.swift
+++ b/Shared/PostCollection/CollectionListView.swift
@@ -1,25 +1,28 @@
import SwiftUI
struct CollectionListView: View {
@EnvironmentObject var model: WriteFreelyModel
var body: some View {
List {
ForEach(model.collections.collectionsList) { collection in
NavigationLink(
destination: PostListView(selectedCollection: collection)
) {
Text(collection.title)
}
}
}
.navigationTitle("Collections")
.listStyle(SidebarListStyle())
}
}
struct CollectionSidebar_Previews: PreviewProvider {
static var previews: some View {
- CollectionListView()
+ let model = WriteFreelyModel()
+ model.collections = CollectionListModel(with: [userCollection1, userCollection2, userCollection3])
+ return CollectionListView()
+ .environmentObject(model)
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Mar 6, 9:57 AM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3166628
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment