diff --git a/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate b/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate index 102dbcb..a7df021 100644 Binary files a/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate and b/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AcaMate/1. View/12. Main/121. Home/HomeView.swift b/AcaMate/1. View/12. Main/121. Home/HomeView.swift index a988a53..4ec26e1 100644 --- a/AcaMate/1. View/12. Main/121. Home/HomeView.swift +++ b/AcaMate/1. View/12. Main/121. Home/HomeView.swift @@ -14,26 +14,34 @@ struct HomeView: View { @State private var topViewState: Bool = false //MARK: - 변경 값 - @State private var myType: UserType = .Student +// @State private var myType: UserType = .Student + @Binding var myType: UserType var body: some View { VStack(spacing: 0) { ZStack { + if !topViewState { + VStack { + Rectangle() + .foregroundStyle(Color(.Other.cell)) + .frame(height: 100 + (scrollOffset.y < 0 ? scrollOffset.y * -1 : 0)) + .frame(maxWidth: .infinity) + .edgesIgnoringSafeArea(.all) + Spacer(minLength: 1) + } + } + OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in - VStack(spacing: 0) { + VStack(spacing: 24) { - TopProfileView(userType: .Student) - .padding(.bottom,12) + TopProfileView(myType: myType) Group { AttendanceBoxView() - -// CalendarBoxView(summaryCalDataList: []) CalendarBoxView(summaryCalDataList: [ SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다."), SummaryCalendar(id: "123", date: "2025-02-28", summary: "요약내용입니다.")]) -// ManagementBoxView(managementList: []) ManagementBoxView(managementList: [ SummaryManagement(id: "01", title: "과목 명1", teacher: "A", ratio: 27, homework: 3), SummaryManagement(id: "02", title: "과목 명2", teacher: "B", ratio: 80, homework: 10), @@ -41,7 +49,6 @@ struct HomeView: View { SummaryManagement(id: "04", title: "과목 명4", teacher: "D", ratio: 72, homework: 0), ]) -// NoticeBoxView(noticeList: []) NoticeBoxView(noticeList: [ SummaryNotice(id: "00", title: "공지사항1", date: "2025-02-11", new: true), SummaryNotice(id: "01", title: "공지사항2", date: "2025-01-11", new: false), @@ -62,8 +69,7 @@ struct HomeView: View { RoundedRectangle(cornerRadius: 8) .foregroundStyle(Color(.Other.cell)) } - .padding(EdgeInsets(top: 12, leading: 24, bottom: 12, trailing: 24)) - + .padding([.leading, .trailing], 24) } } @@ -79,6 +85,8 @@ struct HomeView: View { } .frame(maxWidth: .infinity, maxHeight: .infinity) .onAppear { + // MARK: TO-DO + // 여기도 수정봐야 함 topVM.titleName = "Name" if myType == .Student { diff --git a/AcaMate/1. View/12. Main/121. Home/TopProfileView.swift b/AcaMate/1. View/12. Main/121. Home/TopProfileView.swift index 6cca25e..3f72a0c 100644 --- a/AcaMate/1. View/12. Main/121. Home/TopProfileView.swift +++ b/AcaMate/1. View/12. Main/121. Home/TopProfileView.swift @@ -10,7 +10,7 @@ import SwiftUI struct TopProfileView: View { @StateObject var btnVM = ButtonViewModel() - var userType: UserType + var myType: UserType // MARK: TO-DO // 여기서 이름 떙겨오는것도 고민을 해야 함 @@ -68,7 +68,7 @@ struct TopProfileView: View { // MARK: TO-DO // 여기에 가로스크롤 넣어야 할거 같음 - if userType == .Parent { + if myType == .Parent { HStack(spacing: 0) { ForEach(Array(childIDList.enumerated()),id: \.offset){ index, id in CircleBtnView(vm: btnVM, id: id) @@ -95,7 +95,7 @@ struct TopProfileView: View { // 마켓 버튼과 알림 버튼 동작 로직 구현하기 - switch self.userType { + switch self.myType { case .Student: typeName = "학생" case .Parent: diff --git a/AcaMate/1. View/12. Main/123. Chatting/ChattingView.swift b/AcaMate/1. View/12. Main/123. Chatting/ChattingView.swift index 3f4a7a4..11e4f0a 100644 --- a/AcaMate/1. View/12. Main/123. Chatting/ChattingView.swift +++ b/AcaMate/1. View/12. Main/123. Chatting/ChattingView.swift @@ -17,16 +17,30 @@ struct ChattingView: View { TopView(topVM: topVM) OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in - + VStack(spacing: 24) { + Group { + DashBoardView(image: Image(.Icon.group), title: "클래스") { + + } + DashBoardView(image: Image(.Icon.talk), title: "선생님과 1:1") { + + } + } + .background { + RoundedRectangle(cornerRadius: 8) + .foregroundStyle(Color(.Other.cell)) + } + } + .padding(24) } + + .frame(maxWidth: .infinity, maxHeight: .infinity) } .onAppear { topVM.titleName = "" topVM.setLeftBtn(size: CGPoint(x: 40, y: 40), action: leftAct) topVM.setRightBtn(size: CGPoint(x: 40, y: 40), action: rightAct) - - } } diff --git a/AcaMate/1. View/12. Main/125. Etc/AppInfoView.swift b/AcaMate/1. View/12. Main/125. Etc/AppInfoView.swift index f62805b..59731da 100644 --- a/AcaMate/1. View/12. Main/125. Etc/AppInfoView.swift +++ b/AcaMate/1. View/12. Main/125. Etc/AppInfoView.swift @@ -19,7 +19,7 @@ struct AppInfoView: View { .frame(width: 40, height: 40, alignment: .center) .padding(.trailing, 12) Text("설치 버전: \(currentVer)") - .font(.nps(font: .bold, size: 20)) + .font(.nps(font: .bold, size: 16)) .foregroundStyle(Color(.Text.detail)) Spacer(minLength: 1) if currentVer == finalVer { diff --git a/AcaMate/1. View/12. Main/125. Etc/DevInfoView.swift b/AcaMate/1. View/12. Main/125. Etc/DevInfoView.swift index 197fc8b..f946037 100644 --- a/AcaMate/1. View/12. Main/125. Etc/DevInfoView.swift +++ b/AcaMate/1. View/12. Main/125. Etc/DevInfoView.swift @@ -8,40 +8,45 @@ import SwiftUI struct DevInfoView: View { + + private var attributeText: AttributedString { + let longText = """ + 아래 정보는 해당 프로그램에 관한 정보로서 + 학원에 대한 문의는 더보기 > 고객센터 > 1:1 문의를 이용해주시기 바랍니다. + """ + var attributeText = AttributedString(longText) + attributeText.font = .nps(size: 8) + if let range = attributeText.range(of: "더보기 > 고객센터 > 1:1 문의") { + attributeText[range].font = .nps(font: .bold, size: 8) + } + return attributeText + } + var body: some View { VStack(alignment: .leading, spacing: 24) { - Text(""" - 아래 정보는 해당 프로그램에 관한 정보로서 - 학원에 대한 문의는 더보기 > 고객센터 > 1:1 문의 이용해주시기 바랍니다. - """) - .font(.nps(size: 8)) + + Text(attributeText) .foregroundStyle(Color(.Text.detail)) .lineLimit(2) .multilineTextAlignment(.center) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) - // .padding([.leading,.trailing],24) - - Image(.Logo.appIcon).resizable() - .frame(width: 40, height: 40,alignment: .leading) - .background( - RoundedRectangle(cornerRadius: 8) - .frame(width: 40, height: 40,alignment: .leading) - .foregroundStyle(Color(.Normal.light)) - ) + VStack(alignment: .leading, spacing: 12){ - Text("AcaMate") - .font(.nps(font: .bold, size: 16)) - .foregroundStyle(Color(.Text.detail)) - - VStack(spacing: 4) { - Text("문의: sean.kk@daum.net") - .font(.nps(size: 12)) - .foregroundStyle(Color(.Text.detail)) - - Text("문의: sean.kk@daum.net") - .font(.nps(size: 12)) + HStack(alignment: .center, spacing: 8) { + Image(.Logo.appIcon).resizable() + .frame(width: 40, height: 40,alignment: .leading) + Text("AcaMate") + .font(.nps(font: .bold, size: 16)) .foregroundStyle(Color(.Text.detail)) } + // MARK: TO-DO + // 이부분에 대한 내용은 후에 바꿀 예정 + Text(verbatim:""" + 문의: sean.kk@daum.net + 문의: sean.kk@daum.net + """) + .font(.nps(size: 12)) + .foregroundStyle(Color(.Text.detail)) } diff --git a/AcaMate/1. View/12. Main/125. Etc/EtcView.swift b/AcaMate/1. View/12. Main/125. Etc/EtcView.swift index 26ab919..efef015 100644 --- a/AcaMate/1. View/12. Main/125. Etc/EtcView.swift +++ b/AcaMate/1. View/12. Main/125. Etc/EtcView.swift @@ -9,11 +9,10 @@ import SwiftUI struct EtcView: View { @StateObject private var topVM = TopViewModel() - @State private var scrollOffset: CGPoint = .zero - - - + + @Binding var myType: UserType + var body: some View { VStack(spacing: 0) { TopView(topVM: topVM) @@ -21,7 +20,7 @@ struct EtcView: View { OffsetObservableScrollView(showsIndicators: false, scrollOffset: $scrollOffset) { proxy in VStack(spacing: 24) { UserInfoView(userData: SummaryUser(profile: Image(.Icon.face), name: "이름", userID: "abcdefg", email: "abcdefg@gmail.com")) - UserSettingView() + UserSettingView(myType: myType) CsCenterView() TsCsView() AppInfoView() diff --git a/AcaMate/1. View/12. Main/125. Etc/UserSettingView.swift b/AcaMate/1. View/12. Main/125. Etc/UserSettingView.swift index dbd609a..51e47b5 100644 --- a/AcaMate/1. View/12. Main/125. Etc/UserSettingView.swift +++ b/AcaMate/1. View/12. Main/125. Etc/UserSettingView.swift @@ -8,6 +8,8 @@ import SwiftUI struct UserSettingView: View { + var myType: UserType + var body: some View { EtcBoxView(title: "설정") { VStack(spacing: 0){ @@ -24,6 +26,17 @@ struct UserSettingView: View { // 계정 관리 이동 printLog("계정 관리 이동") } + if myType == .Admin { + DashedDivider() + EtcCellView(title: "관리자 페이지") { + + // MARK: TO-DO + // 이거 분기 쳐서 특정 사용자 아니면 접근 못하게 막기 + + printLog("관리자 페이지 이동") + } + } + } } } diff --git a/AcaMate/1. View/12. Main/MainView.swift b/AcaMate/1. View/12. Main/MainView.swift index f23bb73..412b870 100644 --- a/AcaMate/1. View/12. Main/MainView.swift +++ b/AcaMate/1. View/12. Main/MainView.swift @@ -14,13 +14,15 @@ struct MainView: View { @State var cancellables: Set = [] @Binding var naviState : NaviState + @State private var myType: UserType = .Student + var body: some View { VStack(spacing: 0) { Group { switch appVM.menuName { case .Home: - HomeView() + HomeView(myType: $myType) case .Management: ManagementView() case .Chatting: @@ -28,10 +30,10 @@ struct MainView: View { case .Calendar: CalendarView() case .Etc: - EtcView() + EtcView(myType: $myType) } } - Spacer(minLength: 1) +// Spacer(minLength: 1) BottomView() .frame(maxWidth: .infinity) diff --git a/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Group.imageset/Contents.json b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Group.imageset/Contents.json new file mode 100644 index 0000000..0390b28 --- /dev/null +++ b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Group.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "Group.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Group.imageset/Group.png b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Group.imageset/Group.png new file mode 100644 index 0000000..0a1c149 Binary files /dev/null and b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Group.imageset/Group.png differ diff --git a/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Talk.imageset/Contents.json b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Talk.imageset/Contents.json new file mode 100644 index 0000000..5001aae --- /dev/null +++ b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Talk.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "Talk.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Talk.imageset/Talk.png b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Talk.imageset/Talk.png new file mode 100644 index 0000000..bd4a006 Binary files /dev/null and b/AcaMate/6. Resources/Assets.xcassets/Image Folder/Icon/Talk.imageset/Talk.png differ diff --git a/AcaMate/6. Resources/Images/Icon/Group.png b/AcaMate/6. Resources/Images/Icon/Group.png new file mode 100644 index 0000000..0a1c149 Binary files /dev/null and b/AcaMate/6. Resources/Images/Icon/Group.png differ diff --git a/AcaMate/6. Resources/Images/Icon/Talk.png b/AcaMate/6. Resources/Images/Icon/Talk.png new file mode 100644 index 0000000..bd4a006 Binary files /dev/null and b/AcaMate/6. Resources/Images/Icon/Talk.png differ