forked from AcaMate/AcaMate_iOS
69 lines
2.3 KiB
Swift
69 lines
2.3 KiB
Swift
//
|
|
// UserInfoView.swift
|
|
// AcaMate
|
|
//
|
|
// Created by TAnine on 2/13/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct UserInfoView: View {
|
|
@StateObject var btnVM = ButtonViewModel()
|
|
|
|
@State var notifyBtnID = UUID()
|
|
@State var userData: SummaryUser
|
|
|
|
var body: some View {
|
|
VStack(spacing: 8 ) {
|
|
HStack(spacing: 12) {
|
|
userData.profile.resizable()
|
|
.frame(width: 30, height: 30, alignment: .center)
|
|
Text("\(userData.name)")
|
|
.font(.nps(font: .bold, size: 20))
|
|
.foregroundStyle(Color(.Text.detail))
|
|
Spacer(minLength: 1)
|
|
VStack(alignment: .center, spacing: 0) {
|
|
SimpleBtnView(vm: btnVM, id: notifyBtnID)
|
|
Text("알림설정")
|
|
.font(.nps(font: .bold, size: 8))
|
|
.foregroundStyle(Color(.Text.detail))
|
|
}
|
|
}
|
|
VStack(spacing: 10) {
|
|
HStack(spacing: 0) {
|
|
Text("ID")
|
|
.font(.nps(font: .bold, size: 16))
|
|
.foregroundStyle(Color(.Text.detail))
|
|
Spacer(minLength: 1)
|
|
Text("\(userData.userID)")
|
|
.font(.nps(font: .bold, size: 16))
|
|
.foregroundStyle(Color(.Text.detail))
|
|
}
|
|
HStack(spacing: 0) {
|
|
Text("E-mail")
|
|
.font(.nps(font: .bold, size: 16))
|
|
.foregroundStyle(Color(.Text.detail))
|
|
Spacer(minLength: 1)
|
|
Text("\(userData.email)")
|
|
.font(.nps(font: .bold, size: 16))
|
|
.lineLimit(1)
|
|
.minimumScaleFactor(0.5)
|
|
.truncationMode(.tail)
|
|
.foregroundStyle(Color(.Text.detail))
|
|
}
|
|
}
|
|
.padding(10)
|
|
}
|
|
.padding(12)
|
|
.background {
|
|
RoundedRectangle(cornerRadius: 8)
|
|
.foregroundStyle(Color(.Other.cell))
|
|
}
|
|
.onAppear {
|
|
btnVM.setImage(for: notifyBtnID, newImage: Image(.Icon.notificationSET))
|
|
btnVM.setSize(for: notifyBtnID, newWidth: 24, newHeight: 24)
|
|
}
|
|
}
|
|
}
|
|
|