AcaMate_iOS/AcaMate/1. View/12. Main/122. DashBoard/TopProfileView.swift
2025-02-05 17:59:49 +09:00

105 lines
4.2 KiB
Swift

//
// 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(title: nil,image: Image(.Icon.market),font: nil,
width: 40, height: 40) {
printLog("TEST")
}
Spacer(minLength: 1)
SimpleBtnView(title: nil, image: Image(.Icon.notificationSET), font: nil,
width: 40, height: 40) {
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()
}