From 1d79690f0d6461cafed707845f07ff2e63c8fa12 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 20 Jan 2023 16:26:49 +0800 Subject: [PATCH] Fix search in filter by labels view --- .../Views/ShareExtensionViewComponents.swift | 53 ------------------- .../App/Views/Labels/FilterByLabelsView.swift | 2 +- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionViewComponents.swift diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionViewComponents.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionViewComponents.swift deleted file mode 100644 index 863b91abf..000000000 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionViewComponents.swift +++ /dev/null @@ -1,53 +0,0 @@ -import SwiftUI -import Views - -// TODO: maybe move this into Views package? -// struct IconButtonView: View { -// let title: String -// let systemIconName: String -// let action: () -> Void -// -// var body: some View { -// Button(action: action) { -// VStack(alignment: .center, spacing: 8) { -// Image(systemName: systemIconName) -// .font(.appTitle) -// .foregroundColor(.appYellow48) -// Text(title) -// .font(.appBody) -// .foregroundColor(.appGrayText) -// } -// .frame( -// maxWidth: .infinity, -// maxHeight: .infinity -// ) -// .background(Color.appButtonBackground) -// .cornerRadius(8) -// } -// .frame(height: 100) -// } -// } - -struct CheckmarkButtonView: View { - let titleText: String - let isSelected: Bool - let action: () -> Void - - var body: some View { - Button( - action: action, - label: { - HStack { - Text(titleText) - Spacer() - if isSelected { - Image(systemName: "checkmark") - .foregroundColor(.appYellow48) - } - } - .padding(.vertical, 8) - } - ) - .buttonStyle(RectButtonStyle()) - } -} diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/FilterByLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/FilterByLabelsView.swift index 3cd6d2d7f..5f0eb21ce 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/FilterByLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/FilterByLabelsView.swift @@ -22,7 +22,7 @@ struct FilterByLabelsView: View { var innerBody: some View { List { - ForEach(viewModel.labels, id: \.self) { label in + ForEach(viewModel.labels.applySearchFilter(viewModel.labelSearchFilter), id: \.self) { label in HStack { TextChip(feedItemLabel: label, negated: isNegated(label)) Spacer()