// // TopProfileView.swift // AcaMate // // Created by TAnine on 2/5/25. // import SwiftUI struct TopProfileView: View { var userType: UserType = .ETC var childrenList: [String] = ["name1", "name2", "name3"] var academyName: String = "Academy' NAME" var myName: String = "Name" @State var childNum: Int = 0 var body: some View { VStack(spacing: 0){ VStack(alignment: .center, spacing: 0) { HStack(spacing: 0) { // SimpleBtnView(image: Image(.Icon.market), title: nil, font: nil, // width: 40, height: 40) // .doAction { // printLog("TEST") // } Spacer(minLength: 1) // SimpleBtnView(image: Image(.Icon.notificationSET), title: nil, font: nil, // width: 40, height: 40) // .doAction { // printLog("TEST") // } } /// 최상단 버튼 Stack ZStack{ Circle() .stroke(Color(.Second.normal) ,lineWidth: 4) .frame(width: 200, height: 200) switch self.userType { case .Student: // MARK: TO-DO // 학생일때 표시하는거 어떻게 할 건지 좀 더 고민을 해보자 Image(.Icon.face) .resizable() .frame(width: 150, height: 150) case .Parent: Text("학부모") .font(.nps(font: .bold, size: 48)) .foregroundStyle(Color(.Second.normal)) case .Teacher: Text("선생님") .font(.nps(font: .bold, size: 48)) .foregroundStyle(Color(.Second.normal)) case .Admin: Text("관리자") .font(.nps(font: .bold, size: 48)) .foregroundStyle(Color(.Second.normal)) case .Employee: Text("직원") .font(.nps(font: .bold, size: 48)) .foregroundStyle(Color(.Second.normal)) case .ETC: Text("방문객") .font(.nps(font: .bold, size: 48)) .foregroundStyle(Color(.Second.normal)) } } /// 중앙 원형 Stack .padding([.top, .bottom], 40) VStack(alignment: .center, spacing: 8) { Text("\(self.academyName)") .frame(alignment: .center) .multilineTextAlignment(.center) .font(.nps(font: .bold, size: 36)) Text("\(self.myName)") .multilineTextAlignment(.center) .frame(alignment: .center) .font(.nps(size: 18)) .foregroundStyle(Color(.Text.detail)) } } /// 위쪽 VStack .padding(EdgeInsets(top: 24, leading: 24, bottom: 12, trailing: 24)) HStack(spacing: 0) { // ForEach(Array(childrenList.enumerated()),id: \.offset){ index, name in // CircleBtnView(title: "\(name)", image: Image(.Icon.face), // // MARK: TO-DO // /// 이 바인딩 이거 잘 작동 되는지 후에 확인 할것 // isSelected: Binding( // get: { self.childNum == index }, // set: { _ in self.childNum = index } // ), isReverse: false) { // self.childNum = index // } // if index != childrenList.count-1 { // Spacer() // } // } } /// 아래쪽 HStack .padding([.leading, .trailing], 24) } .fullDrawView(.Other.cell) } } #Preview { TopProfileView() }