mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Replace text label with PostCellView
This commit is contained in:
parent
1ac0ff5b73
commit
8a35fe37f7
@ -11,11 +11,23 @@ struct SearchablePostListFilteredView: View {
|
||||
|
||||
var body: some View {
|
||||
if #available(iOS 16, macOS 13, *) {
|
||||
/// TODO: Add back post search
|
||||
NavigationStack {
|
||||
List(fetchRequest.wrappedValue, id: \.self, selection: $model.navState.selectedPost) { post in
|
||||
NavigationLink(
|
||||
"\(post.title.isEmpty ? "UNTITLED" : post.title)",
|
||||
destination: PostEditorView(post: post)
|
||||
destination: PostEditorView(post: post),
|
||||
label: {
|
||||
if model.navState.showAllPosts {
|
||||
if let collection = collections.filter({ $0.alias == post.collectionAlias }).first {
|
||||
PostCellView(post: post, collectionName: collection.title)
|
||||
} else {
|
||||
let collectionName = model.account.server == "https://write.as" ? "Anonymous" : "Drafts"
|
||||
PostCellView(post: post, collectionName: collectionName)
|
||||
}
|
||||
} else {
|
||||
PostCellView(post: post)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user