fix(component): 텍스트 탭 가로 스크롤을 적용한다

This commit is contained in:
Yu Sung
2026-08-25 16:11:35 +09:00
parent a54465cb1e
commit 425099955b

View File

@@ -11,23 +11,25 @@ struct TextTabBar<Item: Hashable>: View {
let title: (Item) -> String let title: (Item) -> String
var body: some View { var body: some View {
HStack(alignment: .center, spacing: SodaSpacing.s20) { ScrollView(.horizontal) {
ForEach(items.prefix(3), id: \.self) { item in HStack(alignment: .center, spacing: SodaSpacing.s20) {
Button { ForEach(items.prefix(3), id: \.self) { item in
selectedItem = item Button {
} label: { selectedItem = item
Text(title(item)) } label: {
.appFont(.heading3) Text(title(item))
.foregroundColor(selectedItem == item ? Color.white : Color.gray600) .appFont(.heading3)
.frame(height: 52, alignment: .center) .foregroundColor(selectedItem == item ? Color.white : Color.gray600)
.contentShape(Rectangle()) .fixedSize(horizontal: true, vertical: false)
.frame(height: 52, alignment: .center)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
} }
.buttonStyle(.plain)
} }
.padding(.horizontal, SodaSpacing.s20)
Spacer()
} }
.padding(.horizontal, SodaSpacing.s20) .scrollIndicators(.hidden)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.frame(height: 52, alignment: .leading) .frame(height: 52, alignment: .leading)
.background(Color.black) .background(Color.black)