diff options
| author | Fuwn <[email protected]> | 2025-02-20 06:04:18 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-20 06:04:18 -0800 |
| commit | 82d7c141c000a05aa569880ccd44781e43be9654 (patch) | |
| tree | 34886928eccc3ba8dac76e9e54e169eb080eba43 /Sora/Views/Post/PostGridView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-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.swift | 16 |
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) |