// // ServiceCenterView.swift // SodaLive // // Created by klaus on 2023/08/11. // import SwiftUI struct ServiceCenterView: View { @ObservedObject var viewModel = ServiceCenterViewModel() var body: some View { BaseView(isLoading: $viewModel.isLoading) { VStack(spacing: 0) { DetailNavigationBar(title: "고객센터") ScrollView(.vertical, showsIndicators: false) { VStack(spacing: 0) { Image("ic_logo_service_center") .resizable() .scaledToFill() .frame(width: 106.7, height: 106.7, alignment: .top) Text("고객센터") .appFont(size: 20, weight: .bold) .foregroundColor(.grayee) .padding(.top, 20) HStack(spacing: 13.3) { Image("ic_service_center_kakao") .resizable() .scaledToFill() .frame(width: 21, height: 18.8, alignment: .top) Text("TALK 문의") .appFont(size: 13.3, weight: .bold) .foregroundColor(.black) } .padding(.vertical, 14) .frame(maxWidth: .infinity) .background(Color(hex: "ffe368")) .cornerRadius(8) .padding(.horizontal, 13.3) .padding(.top, 20) .onTapGesture { UIApplication.shared.open(URL(string: "http://pf.kakao.com/_lkxgxhG/chat")!) } Rectangle() .frame(width: screenSize().width, height: 6.7) .foregroundColor(.gray23) .padding(.vertical, 20) Text("자주 묻는 질문") .appFont(size: 18.3, weight: .bold) .foregroundColor(.grayee) .frame(maxWidth: .infinity, alignment: .leading) .padding(.horizontal, 13.3) ServiceCenterCategoryView( categories: viewModel.categories, selectedCategory: $viewModel.selectedCategory ) .padding(.vertical, 20) FaqView(faqs: viewModel.faqs) } } } } .sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2) .onAppear { viewModel.getFaqCategories() } } } struct ServiceCenterView_Previews: PreviewProvider { static var previews: some View { ServiceCenterView() } }