summaryrefslogtreecommitdiff
path: root/Sora/Views/Post/PostGridView.swift
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-20 06:04:18 -0800
committerFuwn <[email protected]>2025-02-20 06:04:18 -0800
commit82d7c141c000a05aa569880ccd44781e43be9654 (patch)
tree34886928eccc3ba8dac76e9e54e169eb080eba43 /Sora/Views/Post/PostGridView.swift
parentfeat: Development commit (diff)
downloadsora-testing-82d7c141c000a05aa569880ccd44781e43be9654.tar.xz
sora-testing-82d7c141c000a05aa569880ccd44781e43be9654.zip
feat: Development commit
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)