diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css index e0bb5b1..fd08145 100644 --- a/docs/assets/css/main.css +++ b/docs/assets/css/main.css @@ -885,7 +885,7 @@ input, select, textarea { } .image.filtered:after { - background-image: url("../../images/overlay.png"), linear-gradient(45deg, rgba(114, 97, 147, 0.25) 25%, rgba(227, 123, 124, 0.25) 50%, rgba(255, 228, 180, 0.25)); + background-image: url("../../images/overlay.png"); background-size: 128px 128px, auto; pointer-events: none; content: ''; @@ -2210,7 +2210,7 @@ input, select, textarea { } .panel > *.color0 { - background-image: url("../../images/overlay.png"), linear-gradient(45deg, #726193 20%, #e37b7c 60%, #ffe4b4); + background-image: url("../../images/overlay.png"), linear-gradient(45deg, #028DFF 20%, #028DFF 60%, #1BD5FF); background-size: 128px 128px, auto; } @@ -2223,7 +2223,7 @@ input, select, textarea { .panel > *.color2 { background-image: url("../../images/overlay.png"), linear-gradient(45deg, rgba(114, 97, 147, 0.25) 25%, rgba(227, 123, 124, 0.25) 50%, rgba(255, 228, 180, 0.25)); background-size: 128px 128px, auto; - background-color: #e37b7c; + background-color: #028DFF; } .panel > *.color3 { @@ -2731,7 +2731,7 @@ input, select, textarea { } .panel.color0 { - background-image: url("../../images/overlay.png"), linear-gradient(45deg, #726193 20%, #e37b7c 60%, #ffe4b4); + background-image: url("../../images/overlay.png"), linear-gradient(45deg, white 20%, white 60%, white); background-size: 128px 128px, auto; } diff --git a/docs/images/NOTO icon.png b/docs/images/NOTO icon.png new file mode 100644 index 0000000..131ec15 Binary files /dev/null and b/docs/images/NOTO icon.png differ diff --git a/docs/index.html b/docs/index.html index 60bd96c..15d2ba9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,7 +31,7 @@

NOTO

-->
- +
diff --git a/noto-App/noto-App.xcodeproj/project.pbxproj b/noto-App/noto-App.xcodeproj/project.pbxproj index 58f7221..0a04093 100644 --- a/noto-App/noto-App.xcodeproj/project.pbxproj +++ b/noto-App/noto-App.xcodeproj/project.pbxproj @@ -23,7 +23,9 @@ 621B9BD72CF46B5800451367 /* Main_Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621B9BD62CF46B5300451367 /* Main_Page.swift */; }; 621B9BD92CF46C5100451367 /* Project_Progress_Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621B9BD82CF46C4800451367 /* Project_Progress_Component.swift */; }; 621B9BDB2CF4750400451367 /* Setting_Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621B9BDA2CF474FD00451367 /* Setting_Page.swift */; }; - 621B9BDD2CF47F2C00451367 /* Request_Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621B9BDC2CF47F2700451367 /* Request_Page.swift */; }; + 621B9BDD2CF47F2C00451367 /* RequestList_Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 621B9BDC2CF47F2700451367 /* RequestList_Page.swift */; }; + 62251AA22D008827004E1453 /* RequestDetail_Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62251AA12D00881F004E1453 /* RequestDetail_Page.swift */; }; + 62251AA42D009101004E1453 /* User_DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62251AA32D0090F5004E1453 /* User_DataModel.swift */; }; 627078DE2CE30A660027FF09 /* ColorStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 627078DD2CE30A5D0027FF09 /* ColorStyle.swift */; }; 627FFE9C2CEC295100DF70E8 /* FontStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 627FFE9B2CEC294E00DF70E8 /* FontStyle.swift */; }; 627FFE9E2CEC299700DF70E8 /* Frame_Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 627FFE9D2CEC299300DF70E8 /* Frame_Component.swift */; }; @@ -74,7 +76,9 @@ 621B9BD62CF46B5300451367 /* Main_Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Main_Page.swift; sourceTree = ""; }; 621B9BD82CF46C4800451367 /* Project_Progress_Component.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Project_Progress_Component.swift; sourceTree = ""; }; 621B9BDA2CF474FD00451367 /* Setting_Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Setting_Page.swift; sourceTree = ""; }; - 621B9BDC2CF47F2700451367 /* Request_Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request_Page.swift; sourceTree = ""; }; + 621B9BDC2CF47F2700451367 /* RequestList_Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestList_Page.swift; sourceTree = ""; }; + 62251AA12D00881F004E1453 /* RequestDetail_Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestDetail_Page.swift; sourceTree = ""; }; + 62251AA32D0090F5004E1453 /* User_DataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User_DataModel.swift; sourceTree = ""; }; 623334682CDDE79100DE9DA1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 627078DD2CE30A5D0027FF09 /* ColorStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorStyle.swift; sourceTree = ""; }; 627FFE9B2CEC294E00DF70E8 /* FontStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontStyle.swift; sourceTree = ""; }; @@ -192,10 +196,11 @@ 621B9BCD2CF4448F00451367 /* Page */ = { isa = PBXGroup; children = ( + 62251AA12D00881F004E1453 /* RequestDetail_Page.swift */, 62FB21492CFEAE0300B298F0 /* Project_Page.swift */, 62D1EA692CFDA95B005801F6 /* ProgressList_Page.swift */, 62D1EA622CFD8852005801F6 /* TodoDetail_Page.swift */, - 621B9BDC2CF47F2700451367 /* Request_Page.swift */, + 621B9BDC2CF47F2700451367 /* RequestList_Page.swift */, 621B9BDA2CF474FD00451367 /* Setting_Page.swift */, 621B9BD62CF46B5300451367 /* Main_Page.swift */, ); @@ -221,6 +226,7 @@ 62D1EA5D2CFD80D8005801F6 /* DataModel */ = { isa = PBXGroup; children = ( + 62251AA32D0090F5004E1453 /* User_DataModel.swift */, 62D1EA672CFDA6AC005801F6 /* Project_DataModel.swift */, 62D1EA652CFD9775005801F6 /* Person_DataModel.swift */, 62D1EA602CFD8130005801F6 /* Todo_DataModel.swift */, @@ -365,6 +371,7 @@ 1371F01E2CDDE0150034FC36 /* ContentView.swift in Sources */, 621B9BD72CF46B5800451367 /* Main_Page.swift in Sources */, 627FFE9C2CEC295100DF70E8 /* FontStyle.swift in Sources */, + 62251AA22D008827004E1453 /* RequestDetail_Page.swift in Sources */, 62D1EA612CFD813D005801F6 /* Todo_DataModel.swift in Sources */, 621B9BD92CF46C5100451367 /* Project_Progress_Component.swift in Sources */, 62D1EA632CFD8865005801F6 /* TodoDetail_Page.swift in Sources */, @@ -373,8 +380,9 @@ 627FFE9E2CEC299700DF70E8 /* Frame_Component.swift in Sources */, 1371F0202CDDE0150034FC36 /* Item.swift in Sources */, 62FB214A2CFEAE1800B298F0 /* Project_Page.swift in Sources */, - 621B9BDD2CF47F2C00451367 /* Request_Page.swift in Sources */, + 621B9BDD2CF47F2C00451367 /* RequestList_Page.swift in Sources */, 62D1EA6A2CFDA962005801F6 /* ProgressList_Page.swift in Sources */, + 62251AA42D009101004E1453 /* User_DataModel.swift in Sources */, 62D1EA5F2CFD80F6005801F6 /* Request_DataModel.swift in Sources */, 62D1EA682CFDA6B1005801F6 /* Project_DataModel.swift in Sources */, 1371F01C2CDDE0150034FC36 /* noto_AppApp.swift in Sources */, diff --git a/noto-App/noto-App/Assets.xcassets/mail.imageset/Contents.json b/noto-App/noto-App/Assets.xcassets/mail.imageset/Contents.json new file mode 100644 index 0000000..0ff4b24 --- /dev/null +++ b/noto-App/noto-App/Assets.xcassets/mail.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "mail.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/noto-App/noto-App/Assets.xcassets/mail.imageset/mail.png b/noto-App/noto-App/Assets.xcassets/mail.imageset/mail.png new file mode 100644 index 0000000..b412606 Binary files /dev/null and b/noto-App/noto-App/Assets.xcassets/mail.imageset/mail.png differ diff --git a/noto-App/noto-App/Assets.xcassets/paper-plane.imageset/Contents.json b/noto-App/noto-App/Assets.xcassets/paper-plane.imageset/Contents.json new file mode 100644 index 0000000..93dfb28 --- /dev/null +++ b/noto-App/noto-App/Assets.xcassets/paper-plane.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "paper-plane.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/noto-App/noto-App/Assets.xcassets/paper-plane.imageset/paper-plane.png b/noto-App/noto-App/Assets.xcassets/paper-plane.imageset/paper-plane.png new file mode 100644 index 0000000..545f018 Binary files /dev/null and b/noto-App/noto-App/Assets.xcassets/paper-plane.imageset/paper-plane.png differ diff --git a/noto-App/noto-App/Assets.xcassets/receive.imageset/Contents.json b/noto-App/noto-App/Assets.xcassets/receive.imageset/Contents.json new file mode 100644 index 0000000..33746c4 --- /dev/null +++ b/noto-App/noto-App/Assets.xcassets/receive.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "receive.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/noto-App/noto-App/Assets.xcassets/receive.imageset/receive.png b/noto-App/noto-App/Assets.xcassets/receive.imageset/receive.png new file mode 100644 index 0000000..6e01e67 Binary files /dev/null and b/noto-App/noto-App/Assets.xcassets/receive.imageset/receive.png differ diff --git a/noto-App/noto-App/Component/Frame_Component.swift b/noto-App/noto-App/Component/Frame_Component.swift index 4f36fee..5c033ef 100644 --- a/noto-App/noto-App/Component/Frame_Component.swift +++ b/noto-App/noto-App/Component/Frame_Component.swift @@ -55,6 +55,13 @@ struct viewAllComponent: View { } } +struct dumyBottom: View { + var body: some View { + VStack {} + .frame(width: 120, height: 90) + } +} + // 컴포넌트 정의 extension View { func scrollViewStyle() -> some View { diff --git a/noto-App/noto-App/Component/Header_Component.swift b/noto-App/noto-App/Component/Header_Component.swift index 7d410e1..959df11 100644 --- a/noto-App/noto-App/Component/Header_Component.swift +++ b/noto-App/noto-App/Component/Header_Component.swift @@ -9,7 +9,7 @@ struct mainHeader: View { .scaledToFit() .frame(width: 120) } - .frame(width: .infinity, height: 96, alignment: .bottom) + .frame(width: 120, height: 96, alignment: .bottom) } } diff --git a/noto-App/noto-App/Component/Styles/FontStyle.swift b/noto-App/noto-App/Component/Styles/FontStyle.swift index 8f2eac5..1b23e52 100644 --- a/noto-App/noto-App/Component/Styles/FontStyle.swift +++ b/noto-App/noto-App/Component/Styles/FontStyle.swift @@ -61,7 +61,7 @@ struct ProjectContnentFont: ViewModifier { struct DescriptionFont: ViewModifier { func body(content: Content) -> some View { content - .font(.custom("Freesentation-5Medium", size: 12)) + .font(.custom("Freesentation-5Medium", size: 13)) .foregroundColor(.customDarkGray) .multilineTextAlignment(.leading) .lineSpacing(10) diff --git a/noto-App/noto-App/Component/Sub_Component.swift b/noto-App/noto-App/Component/Sub_Component.swift index 0363408..71d6d33 100644 --- a/noto-App/noto-App/Component/Sub_Component.swift +++ b/noto-App/noto-App/Component/Sub_Component.swift @@ -95,6 +95,68 @@ struct settingRow: View { } } +// 행 컴포넌트 +struct titleRow_1: View { + var title: String + + var body: some View { + HStack { + Text(title) + .titleFont() + .lineLimit(1) + .truncationMode(.tail) + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.horizontal, 20) + } +} + +struct titleRow_2: View { + var title: String + var imageName: String + var imageSize: CGFloat + + var body: some View { + HStack { + Image(imageName) + .resizable() + .frame(width: imageSize, height: imageSize) + .padding(.trailing, 5) + Text(title) + .titleFont() + .lineLimit(1) + .truncationMode(.tail) + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.horizontal, 20) + } +} + +struct titleRow_3: View { + var title: String + var optionAction: () -> Void + + var body: some View { + HStack { + Text(title) + .titleFont() + .lineLimit(1) + .truncationMode(.tail) + Spacer() + Button(action: { + optionAction() + }) { + Image(systemName: "ellipsis") + .font(.system(size: 24)) + .foregroundColor(.customBlack) + } + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.horizontal, 20) + + } +} + enum ShapeType { case circle, rectangle } // 이미지 컴포넌트(크기는 정형 (n x n)) @@ -120,6 +182,7 @@ struct imageComponent: View { } } +// 입력창 컴포넌트 struct inputComponent: View { @Binding var userInput: String var placeholder: String diff --git a/noto-App/noto-App/DataModel/Request_DataModel.swift b/noto-App/noto-App/DataModel/Request_DataModel.swift index 186be3c..6f6bdc1 100644 --- a/noto-App/noto-App/DataModel/Request_DataModel.swift +++ b/noto-App/noto-App/DataModel/Request_DataModel.swift @@ -1,8 +1,9 @@ import SwiftUI -// Request 데이터 모델 -struct Request: Identifiable { +// receivedRequest 데이터 모델 +struct receivedRequest: Identifiable { let id = UUID() // 고유 ID + let rid: Int let sender: String let role: String let title: String @@ -10,37 +11,93 @@ struct Request: Identifiable { let dateSent: Date } +// sendedRequest 데이터 모델 +struct sentRequest: Identifiable { + let id = UUID() // 고유 ID + let rid: Int + let rejected: Int + let receiver: String + let role: String + let title: String + let subtitle: String + let dateSent: Date +} + let dateFormatter: DateFormatter = { let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd HH:mm" return formatter }() -// Request 더미데이터 -let requests: [Request] = [ - Request(sender: "김지민", - role: "관리자", - title: "새로운 할 일 배정", - subtitle: "할 일 추가: '할 일 완료 체크 기능 구현' 작업에 배정되었습니다. 이 작업을 수락하시겠습니까?", - dateSent: dateFormatter.date(from: "2024-11-10 14:00")!), - Request(sender: "한나리", - role: "참가자", - title: "프로젝트 참여 요청", - subtitle: "'iOS 앱 테스트' 프로젝트에 배정되었습니다. 이 프로젝트에 참여하시겠습니까?", - dateSent: dateFormatter.date(from: "2024-10-12 15:30")!), - Request(sender: "임진우", - role: "참가자", - title: "할 일 수정 요청", - subtitle: "'할 일 삭제 기능 구현' 작업의 기한이 변경되었습니다. 수정된 기한을 수락하시겠습니까?", - dateSent: dateFormatter.date(from: "2024-10-11 16:00")!), - Request(sender: "김지민", - role: "관리자", - title: "프로젝트 파일 검토 요청", - subtitle: "프로젝트 'iOS Todo 앱'의 문서 검토 요청이 왔습니다. 검토 후 승인하시겠습니까?", - dateSent: dateFormatter.date(from: "2024-10-10 09:11")!), - Request(sender: "한나리", - role: "참가자", - title: "할 일 우선순위 변경 요청", - subtitle: "현재 작업 중인 'UI 스타일링' 작업의 우선순위가 변경되었습니다. 이를 수락하시겠습니까?", - dateSent: dateFormatter.date(from: "2024-10-09 23:54")!), +// Request 더미데이터 (사용자가 받은 요청) +let receivedRequests: [receivedRequest] = [ + receivedRequest(rid: 0, + sender: "김지민", + role: "관리자", + title: "새로운 할 일 배정", + subtitle: "할 일 추가: '할 일 완료 체크 기능 구현' 작업에 배정되었습니다. 이 작업을 수락하시겠습니까?", + dateSent: dateFormatter.date(from: "2024-11-10 14:00")!), + receivedRequest(rid: 1, + sender: "한나리", + role: "참가자", + title: "프로젝트 참여 요청", + subtitle: "'iOS 앱 테스트' 프로젝트에 배정되었습니다. 이 프로젝트에 참여하시겠습니까?", + dateSent: dateFormatter.date(from: "2024-10-12 15:30")!), + receivedRequest(rid: 2, + sender: "임진우", + role: "참가자", + title: "할 일 수정 요청", + subtitle: "'할 일 삭제 기능 구현' 작업의 기한이 변경되었습니다. 수정된 기한을 수락하시겠습니까?", + dateSent: dateFormatter.date(from: "2024-10-11 16:00")!), + receivedRequest(rid: 3, + sender: "김지민", + role: "관리자", + title: "프로젝트 파일 검토 요청", + subtitle: "프로젝트 'iOS Todo 앱'의 문서 검토 요청이 왔습니다. 검토 후 승인하시겠습니까?", + dateSent: dateFormatter.date(from: "2024-10-10 09:11")!), + receivedRequest(rid: 4, + sender: "한나리", + role: "참가자", + title: "할 일 우선순위 변경 요청", + subtitle: "현재 작업 중인 'UI 스타일링' 작업의 우선순위가 변경되었습니다. 이를 수락하시겠습니까?", + dateSent: dateFormatter.date(from: "2024-10-09 23:54")!) +] + +// Request 더미데이터 (사용자가 보낸 요청) +let sentRequests: [sentRequest] = [ + sentRequest(rid: 0, + rejected: 0, + receiver: "한나리", + role: "참가자", + title: "작업 요청", + subtitle: "할 일: '테스트 시나리오 작성' 작업을 수행해 주세요.", + dateSent: dateFormatter.date(from: "2024-11-08 10:00")!), + sentRequest(rid: 1, + rejected: 0, + receiver: "한나리", + role: "참가자", + title: "프로젝트 초대", + subtitle: "프로젝트 'iOS 앱 테스트'에 초대되었습니다. 참여를 수락해 주세요.", + dateSent: dateFormatter.date(from: "2024-11-07 15:45")!), + sentRequest(rid: 2, + rejected: 1, + receiver: "임진우", + role: "참가자", + title: "기한 연장 요청", + subtitle: "현재 진행 중인 '디자인 검토' 작업의 기한을 3일 연장해 주세요.", + dateSent: dateFormatter.date(from: "2024-11-06 14:30")!), + sentRequest(rid: 3, + rejected: 1, + receiver: "임진우", + role: "참가자", + title: "작업 우선순위 변경", + subtitle: "'UI 테스트' 작업의 우선순위를 조정해 주세요.", + dateSent: dateFormatter.date(from: "2024-11-05 09:00")!), + sentRequest(rid: 4, + rejected: 0, + receiver: "한나리", + role: "참가자", + title: "작업 완료 검토 요청", + subtitle: "'UI 스타일링' 작업을 완료했습니다. 검토 후 승인해 주세요.", + dateSent: dateFormatter.date(from: "2024-11-04 13:20")!) ] diff --git a/noto-App/noto-App/DataModel/User_DataModel.swift b/noto-App/noto-App/DataModel/User_DataModel.swift new file mode 100644 index 0000000..93a63cf --- /dev/null +++ b/noto-App/noto-App/DataModel/User_DataModel.swift @@ -0,0 +1,11 @@ +import SwiftUI + +// 앱 사용자 데이터 모델 +struct user: Identifiable { + let id = UUID() // 고유 ID + let uid: Int + let name: String + let role: String +} + +let userInfo: user = user(uid: 0, name: "김지민", role: "admin") diff --git a/noto-App/noto-App/Page/Main_Page.swift b/noto-App/noto-App/Page/Main_Page.swift index 88079a7..48b5312 100644 --- a/noto-App/noto-App/Page/Main_Page.swift +++ b/noto-App/noto-App/Page/Main_Page.swift @@ -1,7 +1,7 @@ import SwiftUI enum Tab { case settings, home, projects } -enum Page { case main, requestList, todoDetail, progressList, todoList, projectDetail } +enum Page { case main, requestList, requestDetail, todoDetail, progressList, todoList, projectDetail } struct MainPage_ContentView: View { @State private var selectedTab: Tab = .home @@ -31,7 +31,10 @@ struct MainPage_ContentView_Preview: PreviewProvider { struct mainPage: View { @State private var searchText = "" @State private var currentScreen: Page = .main - @State private var clickedIndex: Int? = 0 + @State private var selectedId: Int = 0 + @State private var selectedRid: Int = 0 + @State private var selectedRequestType: Int = 0 + @State private var selectedRequestRejected: Int = 0 @Binding var selectedTab: Tab @@ -55,7 +58,7 @@ struct mainPage: View { subtitle: todo.subtitle, action: { currentScreen = .todoDetail - clickedIndex = index // 클릭된 인덱스 저장 + selectedId = index // 클릭된 인덱스 저장 } ) } @@ -64,7 +67,7 @@ struct mainPage: View { .padding(.horizontal, 20) } } - viewAllComponent(title: "오늘 내 할 일 모두 보기", action: {currentScreen = .progressList}) + viewAllComponent(title: "오늘 내 할 일 모두 보기", action: {currentScreen = .todoList}) } .blockStyle(height: .infinity) @@ -73,8 +76,8 @@ struct mainPage: View { simpleProgressRow(title: projectList[index].name, progress: projectList[index].progress, Dday: calculateDDay(from: projectList[index].startDate, to: projectList[index].endDate), - action: { print("프로젝트 클릭 수정 필요") - clickedIndex = index}) + action: { currentScreen = .projectDetail + selectedId = projectList[index].pid}) } viewAllComponent(title: "프로젝트 진행 현황 모두 보기", action: {currentScreen = .progressList}) @@ -88,13 +91,26 @@ struct mainPage: View { } .scrollViewStyle() } else if(currentScreen == .requestList) { - RequestPage(currentScreen: $currentScreen) + RequestListPage(currentScreen: $currentScreen, + selectedRid: $selectedRid, + selectedRequestType: $selectedRequestType, + selectedRequestRejected: $selectedRequestRejected) } else if(currentScreen == .todoDetail) { - TodoDetialPage(currentScreen: $currentScreen, prevScreen: .main, index: clickedIndex ?? 0) + TodoDetialPage(currentScreen: $currentScreen, prevScreen: .main, index: selectedId) } else if(currentScreen == .progressList) { - ProgressDetailPage(currentScreen: $currentScreen, prevScreen: .main, index: clickedIndex ?? 0) + ProgressDetailPage(currentScreen: $currentScreen, prevScreen: .main, pid: selectedId) } else if(currentScreen == .todoList) { - + // 여기는 모달 올라오게 만들기 + } else if(currentScreen == .requestDetail) { + RequestDetailPage(currentScreen: $currentScreen, + prevScreen: .main, + rid: selectedRid, + type: selectedRequestType, + rejected: selectedRequestRejected) + } else if(currentScreen == .projectDetail) { + ProjectPage(currentScreen: $currentScreen, + prevScreen: currentScreen, + pid: selectedId) } } } @@ -109,3 +125,5 @@ struct ProjectSelectionView: View { } } } + + diff --git a/noto-App/noto-App/Page/ProgressList_Page.swift b/noto-App/noto-App/Page/ProgressList_Page.swift index f29d854..7681a1f 100644 --- a/noto-App/noto-App/Page/ProgressList_Page.swift +++ b/noto-App/noto-App/Page/ProgressList_Page.swift @@ -5,7 +5,7 @@ struct ProgressDetailPage_ContentView: View { @State private var prevScreen: Page = .main @State private var clickedIndex: Int = 1 var body: some View { - ProgressDetailPage(currentScreen: $currentScreen, prevScreen: prevScreen, index: clickedIndex) + ProgressDetailPage(currentScreen: $currentScreen, prevScreen: prevScreen, pid: clickedIndex) } } @@ -19,7 +19,7 @@ struct ProgressDetailPage: View { @State private var searchText = "" @Binding var currentScreen: Page var prevScreen: Page - var index: Int + var pid: Int var body: some View { VStack { @@ -38,7 +38,7 @@ struct ProgressDetailPage: View { projectContentRows(projectIndex: index) .padding(.bottom, 10) } - viewAllComponent(title: "프로젝트 페이지로 이동", action: {print("프로젝트 이동 클릭")}) + viewAllComponent(title: "프로젝트 페이지로 이동", action: {currentScreen = .projectDetail}) } .blockStyle(height: .infinity) } diff --git a/noto-App/noto-App/Page/Project_Page.swift b/noto-App/noto-App/Page/Project_Page.swift index 5f6c332..d92dd2b 100644 --- a/noto-App/noto-App/Page/Project_Page.swift +++ b/noto-App/noto-App/Page/Project_Page.swift @@ -4,10 +4,8 @@ struct ProjectPage_ContentView: View { @State private var currentScreen: Page = .projectDetail @State private var prevScreen: Page = .main @State private var pid: Int = 0 - @State private var selectedDate: Date? = nil var body: some View { - ProjectPage(selectedDate: $selectedDate, - currentScreen: $currentScreen, + ProjectPage(currentScreen: $currentScreen, prevScreen: prevScreen, pid: pid) } @@ -21,53 +19,59 @@ struct ProjectPage_ContentView_Preview: PreviewProvider { struct ProjectPage: View { @State private var searchText = "" - @Binding var selectedDate: Date? + @State var selectedDate: Date = Date() @Binding var currentScreen: Page + @Namespace var todoSection var prevScreen: Page var pid: Int let calendar = Calendar.current var body: some View { - let project = projectList[pid] + let project = projectList.filter { project in + return project.pid == pid // startDate와 endDate 사이인지 확인 + } + VStack { - ScrollView { - VStack(spacing: 20) { - mainHeader() - requestComponent(req_count: 5, action: { currentScreen = .requestList }) - - VStack{ - VStack(alignment: .leading, spacing: 5) { - Spacer() - titleRow(title: project.name, optionAction: {print("설정 버튼 수정 필요")}) - .padding(.top, 10) - Divider() - .padding(10) - VStack(alignment: .leading, spacing: 15){ - dateRow(startDate: project.startDate, endDate: project.endDate) - participantRow() + ScrollViewReader { proxy in + ScrollView { + VStack(spacing: 20) { + mainHeader() + requestComponent(req_count: 5, action: { currentScreen = .requestList }) + + VStack{ + VStack(alignment: .leading, spacing: 5) { + Spacer() + titleRow_3(title: project[0].name, optionAction: {print("프로젝트 설정 버튼 클릭 (수정 필요)")}) + .padding(.top, 10) Divider() - .padding(.horizontal, 10) - descriptionRow(description: project.description) + .padding(10) + VStack(alignment: .leading, spacing: 15){ + dateRow(startDate: project[0].startDate, endDate: project[0].endDate) + participantRow() + Divider() + .padding(.horizontal, 10) + descriptionRow(description: project[0].description) + } + Spacer() } + } + .blockStyle(height: .infinity) + + VStack{ Spacer() + CalendarView(selectedDate: $selectedDate, + onDateSelected: { + withAnimation{ proxy.scrollTo(todoSection, anchor: .bottom) } + }, project: project[0]) + .padding(.top, 10) } - } - .blockStyle(height: .infinity) - - VStack{ - Spacer() - CalendarView(selectedDate: $selectedDate, project: project) - .padding(.top, 10) - } - .blockStyle(height: .infinity) - - if(selectedDate != nil) { + .blockStyle(height: .infinity) + VStack(spacing: 10) { Spacer() let filteredTodos = todolist.filter { todo in - guard let selectedDate = selectedDate else { return false } return (todo.startDate...todo.endDate).contains(selectedDate) // startDate와 endDate 사이인지 확인 } @@ -98,11 +102,14 @@ struct ProjectPage: View { viewAllComponent(title: "오늘 내 할 일 모두 보기", action: {currentScreen = .todoList}) } .blockStyle(height: .infinity) + + dumyBottom() + .id(todoSection) } + .backgroundStyle() } - .backgroundStyle() + .scrollViewStyle() } - .scrollViewStyle() } } } @@ -110,21 +117,24 @@ struct ProjectPage: View { struct CalendarView: View { // 현재 월 및 연도 @State private var currentDate = Date() - @Binding var selectedDate: Date? + @Binding var selectedDate: Date + var onDateSelected: () -> Void let calendar = Calendar.current let project: project var body: some View { VStack(alignment: .leading) { Spacer() - titleRow(title: "\(monthAndYear(for: currentDate)) 캘린더", optionAction: {print("설정 버튼 수정 필요")}) + titleRow_3(title: "\(monthAndYear(for: currentDate)) 캘린더", optionAction: {print("캘린더 설정 버튼 클릭 (수정 필요)")}) Divider() .padding(.horizontal, 20) .padding(.top, 10) // 캘린더 레이아웃 - CalendarGridView(currentDate: $currentDate, selectedDate: $selectedDate) + CalendarGridView(currentDate: $currentDate, + selectedDate: $selectedDate, + onDateSelected: onDateSelected) .padding() } @@ -141,13 +151,15 @@ struct CalendarView: View { struct CalendarGridView: View { @Binding var currentDate: Date - @Binding var selectedDate: Date? + @Binding var selectedDate: Date + var onDateSelected: () -> Void let calendar = Calendar.current var body: some View { let daysInMonth = getDaysInMonth(for: currentDate) let firstDayOfMonth = getFirstDayOfMonth(for: currentDate) let weekdays = calendar.shortWeekdaySymbols + let components = calendar.dateComponents([.year, .month, .day], from: selectedDate) VStack(spacing: 5) { // 요일 헤더 @@ -166,19 +178,28 @@ struct CalendarGridView: View { ForEach(0.. Void - - var body: some View { - HStack { - Text(title) - .titleFont() - .lineLimit(1) - .truncationMode(.tail) - Spacer() - Button(action: { - optionAction() - }) { - Image(systemName: "ellipsis") - .font(.system(size: 24)) - .foregroundColor(.customBlack) - } - } - .frame(maxWidth: .infinity, alignment: .leading) - .padding(.horizontal, 20) - - } -} - struct dateRow: View { var startDate: Date var endDate: Date diff --git a/noto-App/noto-App/noto_AppApp.swift b/noto-App/noto-App/noto_AppApp.swift index 7162cc1..f482b9d 100644 --- a/noto-App/noto-App/noto_AppApp.swift +++ b/noto-App/noto-App/noto_AppApp.swift @@ -18,8 +18,9 @@ struct noto_AppApp: App { var body: some Scene { WindowGroup { - //ContentView() - MainPage_ContentView() + //ContentView() + MainPage_ContentView() + //ProjectPage_ContentView() } .modelContainer(sharedModelContainer)