고객센터 페이지 추가

This commit is contained in:
Yu Sung
2023-08-11 07:33:38 +09:00
parent e082e07fa6
commit 64b0380671
13 changed files with 482 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
//
// ServiceCenterCategoryView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
struct ServiceCenterCategoryView: View {
let columns = [
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible()),
]
let categories: [String]
@Binding var selectedCategory: String
var body: some View {
LazyVGrid(columns: columns, spacing: 10) {
ForEach(categories, id: \.self) { category in
ServiceCenterCategoryItemView(
category: category,
isSelected: selectedCategory == category
)
.frame(height: 46.7)
.onTapGesture {
if selectedCategory != category {
selectedCategory = category
}
}
}
}
.padding(.horizontal, 13.3)
}
}
struct ServiceCenterCategoryView_Previews: PreviewProvider {
static var previews: some View {
ServiceCenterCategoryView(
categories: ["전체", "사용방법", "수다", "결제/환불", "서비스/기타"],
selectedCategory: .constant("전체")
)
}
}