adjust tappable area of text chip buttons

This commit is contained in:
Satindar Dhillon
2022-04-13 13:42:51 -07:00
parent 1e2901c4e7
commit a75c8e91a4
2 changed files with 17 additions and 12 deletions

View File

@ -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

View File

@ -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())
}
}
}