summaryrefslogtreecommitdiff
path: root/Sora/Views/Post
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-28 03:33:21 -0800
committerFuwn <[email protected]>2025-02-28 03:33:21 -0800
commite084ee2714c76f9081d4c57d07dec7ddd21783c2 (patch)
treec0798a5d409bd320d89905952475298ee8bec79f /Sora/Views/Post
parentfeat: Development commit (diff)
downloadsora-testing-e084ee2714c76f9081d4c57d07dec7ddd21783c2.tar.xz
sora-testing-e084ee2714c76f9081d4c57d07dec7ddd21783c2.zip
feat: Development commit
Diffstat (limited to 'Sora/Views/Post')
-rw-r--r--Sora/Views/Post/Grid/PostGridSearchHistoryView.swift (renamed from Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryView.swift)5
-rw-r--r--Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryItemView.swift39
2 files changed, 4 insertions, 40 deletions
diff --git a/Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryView.swift b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
index be2d2ea..2f95118 100644
--- a/Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryView.swift
+++ b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
@@ -47,7 +47,10 @@ struct PostGridSearchHistoryView: View {
manager.performSearch()
}
}) {
- PostGridSearchHistoryItemView(query: query)
+ GenericItemView(
+ item: query,
+ removeAction: settings.removeSearchHistoryEntry
+ )
}
#if os(macOS)
.buttonStyle(.plain)
diff --git a/Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryItemView.swift b/Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryItemView.swift
deleted file mode 100644
index 5e0b7ce..0000000
--- a/Sora/Views/Post/Grid/SearchHistory/PostGridSearchHistoryItemView.swift
+++ /dev/null
@@ -1,39 +0,0 @@
-import SwiftUI
-
-struct PostGridSearchHistoryItemView: View {
- @EnvironmentObject var settings: SettingsManager
- var query: BooruSearchQuery
-
- var body: some View {
- #if os(macOS)
- HStack {
- VStack(alignment: .leading) {
- Text(query.tags.joined(separator: ", ").lowercased())
-
- Spacer()
-
- Text("On \(query.searchedAt.formatted()) from \(query.provider.rawValue)")
- .font(.caption)
- .foregroundStyle(Color.secondary)
- }
-
- Spacer()
-
- Button {
- settings.removeSearchHistoryEntry(withID: query.id)
- } label: {
- Image(systemName: "trash")
- }
- }
- .padding()
- #else
- VStack(alignment: .leading) {
- Text(query.tags.joined(separator: ", ").lowercased())
-
- Text("On \(query.searchedAt.formatted()) from \(query.provider.rawValue)")
- .font(.caption)
- .foregroundStyle(Color.secondary)
- }
- #endif
- }
-}