fix(component): 텍스트 탭 가로 스크롤을 적용한다
This commit is contained in:
@@ -11,23 +11,25 @@ struct TextTabBar<Item: Hashable>: View {
|
||||
let title: (Item) -> String
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center, spacing: SodaSpacing.s20) {
|
||||
ForEach(items.prefix(3), id: \.self) { item in
|
||||
Button {
|
||||
selectedItem = item
|
||||
} label: {
|
||||
Text(title(item))
|
||||
.appFont(.heading3)
|
||||
.foregroundColor(selectedItem == item ? Color.white : Color.gray600)
|
||||
.frame(height: 52, alignment: .center)
|
||||
.contentShape(Rectangle())
|
||||
ScrollView(.horizontal) {
|
||||
HStack(alignment: .center, spacing: SodaSpacing.s20) {
|
||||
ForEach(items.prefix(3), id: \.self) { item in
|
||||
Button {
|
||||
selectedItem = item
|
||||
} label: {
|
||||
Text(title(item))
|
||||
.appFont(.heading3)
|
||||
.foregroundColor(selectedItem == item ? Color.white : Color.gray600)
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
.frame(height: 52, alignment: .center)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
.padding(.horizontal, SodaSpacing.s20)
|
||||
}
|
||||
.padding(.horizontal, SodaSpacing.s20)
|
||||
.scrollIndicators(.hidden)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 52, alignment: .leading)
|
||||
.background(Color.black)
|
||||
|
||||
Reference in New Issue
Block a user