summaryrefslogtreecommitdiff
path: root/Sora/Views/Post/PostGridView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views/Post/PostGridView.swift')
-rw-r--r--Sora/Views/Post/PostGridView.swift16
1 files changed, 16 insertions, 0 deletions
diff --git a/Sora/Views/Post/PostGridView.swift b/Sora/Views/Post/PostGridView.swift
index 2eda971..487bde8 100644
--- a/Sora/Views/Post/PostGridView.swift
+++ b/Sora/Views/Post/PostGridView.swift
@@ -82,6 +82,22 @@ struct PostGridView: View {
}
}
#endif
+ .toolbar {
+ if !manager.tags.isEmpty {
+ ToolbarItem(placement: .bottomBar) {
+ let contained = settings.bookmarks.contains(where: { $0.tags == manager.tags })
+
+ Button(action: {
+ contained ? settings.removeBookmark(withTags: manager.tags) : settings.addBookmark(tags: manager.tags)
+ }) {
+ Label("Bookmark", systemImage:
+ contained ?
+ "bookmark.fill" :
+ "bookmark")
+ }
+ }
+ }
+ }
.navigationTitle("Posts")
.refreshable {
await manager.fetchPosts(page: 1, tags: manager.tags, replace: true)