From 3410a58a891726ee424587bef481ed0d30bc74d2 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 11 May 2022 13:09:30 -0700 Subject: [PATCH] adjust tappable area of text chip buttons --- .../App/Views/Home/HomeFeedViewIOS.swift | 2 +- .../OmnivoreKit/Sources/Views/TextChip.swift | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 69b5028c7..7fff92964 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -127,7 +127,7 @@ private let enableGrid = UIDevice.isIPad || FeatureFlag.enableGridCardsOnPhone var body: some View { VStack(spacing: 0) { SearchBar(searchTerm: $viewModel.searchTerm, isSearching: $isSearching) - .padding(.bottom) + ZStack(alignment: .bottom) { ScrollView(.horizontal, showsIndicators: false) { HStack { diff --git a/apple/OmnivoreKit/Sources/Views/TextChip.swift b/apple/OmnivoreKit/Sources/Views/TextChip.swift index 20a6a4d13..2c2bd5c8b 100644 --- a/apple/OmnivoreKit/Sources/Views/TextChip.swift +++ b/apple/OmnivoreKit/Sources/Views/TextChip.swift @@ -91,23 +91,21 @@ public struct TextChipButton: View { let foregroundColor: Color public var body: some View { - Button(action: onTap) { - VStack(spacing: 0) { - HStack { - Text(text) - .padding(.leading, 3) - Image(systemName: actionType.systemIconName) - } - .padding(.horizontal, 10) - .padding(.vertical, 8) - .font(.appFootnote) - .foregroundColor(foregroundColor) - .lineLimit(1) - .background(Capsule().fill(color)) - - Color.clear.contentShape(Rectangle()).frame(height: 15) + VStack(spacing: 0) { + HStack { + Text(text) + .padding(.leading, 3) + Image(systemName: actionType.systemIconName) } - .contentShape(Rectangle()) + .padding(.horizontal, 10) + .padding(.vertical, 8) + .font(.appFootnote) + .foregroundColor(foregroundColor) + .lineLimit(1) + .background(Capsule().fill(color)) } + .padding(.vertical, 12) + .contentShape(Rectangle()) + .onTapGesture { onTap() } } }