From a75c8e91a464ec257dd5dc0e7036c6724a9c61aa Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 13 Apr 2022 13:42:51 -0700 Subject: [PATCH] adjust tappable area of text chip buttons --- .../App/Views/Home/HomeFeedViewIOS.swift | 3 +-- .../OmnivoreKit/Sources/Views/TextChip.swift | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 7f6893916..a5440b461 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -115,7 +115,7 @@ import Views @ObservedObject var viewModel: HomeFeedViewModel var body: some View { - VStack { + VStack(spacing: 0) { ScrollView(.horizontal, showsIndicators: false) { HStack { TextChipButton.makeAddLabelButton { @@ -128,7 +128,6 @@ import Views } Spacer() } - .padding(.bottom, 5) .padding(.horizontal) .sheet(isPresented: $showLabelsSheet) { ApplyLabelsView(mode: .list(viewModel.selectedLabels)) { labels in diff --git a/apple/OmnivoreKit/Sources/Views/TextChip.swift b/apple/OmnivoreKit/Sources/Views/TextChip.swift index 2a09428e2..83ee595a9 100644 --- a/apple/OmnivoreKit/Sources/Views/TextChip.swift +++ b/apple/OmnivoreKit/Sources/Views/TextChip.swift @@ -91,17 +91,23 @@ public struct TextChipButton: View { public var body: some View { Button(action: onTap) { - HStack { - Text(text) - Image(systemName: actionType.systemIconName) + 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(color) + .cornerRadius(cornerRadius) + + Color.clear.contentShape(Rectangle()).frame(height: 15) } - .padding(.horizontal, 10) - .padding(.vertical, 8) - .font(.appFootnote) - .foregroundColor(foregroundColor) - .lineLimit(1) - .background(color) - .cornerRadius(cornerRadius) + .contentShape(Rectangle()) } } }