diff options
| author | Fuwn <[email protected]> | 2025-02-26 23:16:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-26 23:16:32 -0800 |
| commit | fc2fde241949c050e80aa36e45117f1e9e7a5251 (patch) | |
| tree | b5a3fbd78c79a89d0d964aa84be02fdfd226fb34 | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-fc2fde241949c050e80aa36e45117f1e9e7a5251.tar.xz sora-testing-fc2fde241949c050e80aa36e45117f1e9e7a5251.zip | |
feat: Development commit
| -rw-r--r-- | Sora/Views/Post/Details/PostDetailsTagsView.swift | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Sora/Views/Post/Details/PostDetailsTagsView.swift b/Sora/Views/Post/Details/PostDetailsTagsView.swift index 94f9f69..452906a 100644 --- a/Sora/Views/Post/Details/PostDetailsTagsView.swift +++ b/Sora/Views/Post/Details/PostDetailsTagsView.swift @@ -10,15 +10,29 @@ struct PostDetailsTagsView: View { ForEach(tags, id: \.self) { tag in Button(action: { manager.searchText = tag - manager.selectedPost = nil - manager.performSearch() - isPresented.toggle() + + search() }) { Text(tag) } + .contextMenu { + Button(action: { + manager.searchText += " \(tag)" + + search() + }) { + Label("Add to current search query", systemImage: "plus") + } + } } } } + + private func search() { + manager.selectedPost = nil + manager.performSearch() + isPresented.toggle() + } } #Preview { |