diff --git a/Application/Resources/Assets.xcassets/Image/Icon/Camera.imageset/Contents.json b/Application/Resources/Assets.xcassets/Image/Icon/Camera.imageset/Contents.json new file mode 100644 index 00000000..5b63c0cf --- /dev/null +++ b/Application/Resources/Assets.xcassets/Image/Icon/Camera.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "material-symbols_photo-camera-outline.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Application/Resources/Assets.xcassets/Image/Icon/Camera.imageset/material-symbols_photo-camera-outline.svg b/Application/Resources/Assets.xcassets/Image/Icon/Camera.imageset/material-symbols_photo-camera-outline.svg new file mode 100644 index 00000000..29641863 --- /dev/null +++ b/Application/Resources/Assets.xcassets/Image/Icon/Camera.imageset/material-symbols_photo-camera-outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Application/Sources/ResoucesCode/Image.swift b/Application/Sources/ResoucesCode/Image.swift index a9e0c183..2928819c 100644 --- a/Application/Sources/ResoucesCode/Image.swift +++ b/Application/Sources/ResoucesCode/Image.swift @@ -12,6 +12,7 @@ extension Image { static let onboardingXquare = Image("Onboarding-Xquare") // Icon + static let camera = Image("Camera") static let application = Image("Application") static let bell = Image("Bell") static let bellWithBadge = Image("Bell.badge") diff --git a/Application/Sources/Router/XQUARE/XquareRouterFactory.swift b/Application/Sources/Router/XQUARE/XquareRouterFactory.swift index 368823b0..10c0078e 100644 --- a/Application/Sources/Router/XQUARE/XquareRouterFactory.swift +++ b/Application/Sources/Router/XQUARE/XquareRouterFactory.swift @@ -148,6 +148,7 @@ class XquareRouterFactory: RouterFactory { fetchReleaseNoteUseCase: reportServiceDependency.fetchReleaseNoteUseCase ) self.releaseNoteView = ReleaseNoteView(viewModel: releaseNoteViewModel) + } // swiftlint:enable function_body_length diff --git a/Application/Sources/Scene/Entire/EntireView.swift b/Application/Sources/Scene/Entire/EntireView.swift index 3678a2a8..9533d6bb 100644 --- a/Application/Sources/Scene/Entire/EntireView.swift +++ b/Application/Sources/Scene/Entire/EntireView.swift @@ -28,8 +28,8 @@ struct EntireView: View, XNavigationAndTabContent { ServiceSectionButtonView( headerText: "앱", services: [ - (text: "로그아웃", action: { viewModel.showLogoutAlert = true }) -// (text: "업데이트 사항", action: { xquareRouter.navigateTo(.releaseNote) }) + (text: "로그아웃", action: { viewModel.showLogoutAlert = true }), + (text: "업데이트 사항", action: { xquareRouter.navigateTo(.releaseNote) }) ]) Spacer() } diff --git a/Application/Sources/Scene/MyPage/Information/MyInformationView.swift b/Application/Sources/Scene/MyPage/Information/MyInformationView.swift index 35f6c801..5899ca8d 100644 --- a/Application/Sources/Scene/MyPage/Information/MyInformationView.swift +++ b/Application/Sources/Scene/MyPage/Information/MyInformationView.swift @@ -22,6 +22,7 @@ struct MyInformationView: View { .padding(.leading, 16) .frame(height: 44) .background(Color.GrayScale.gray50) + .cornerRadius(8) .overlay { RoundedRectangle(cornerRadius: 8).stroke(Color.GrayScale.gray300) } } .padding(.bottom, 20) diff --git a/Application/Sources/Scene/MyPage/MyPageView.swift b/Application/Sources/Scene/MyPage/MyPageView.swift index fca139b7..2a7f56ef 100644 --- a/Application/Sources/Scene/MyPage/MyPageView.swift +++ b/Application/Sources/Scene/MyPage/MyPageView.swift @@ -12,23 +12,17 @@ struct MyPageView: View { alignment: .center, spacing: 0 ) { - Spacer() - .frame(height: 34) - ProfileImageView( + Spacer().frame(height: 20) + MyProfileView( imageUrl: viewModel.profileImagrUrl, - uiimage: $viewModel.profileImage + uiimage: $viewModel.profileImage, + name: viewModel.name, + gradeClassNum: viewModel.gradeClassNum, + xPhotosIsPresented: $viewModel.xPhotosIsPresented ) - Button { - viewModel.xPhotosIsPresented = true - } label: { - Text("변경하기") - .sdText(type: .body4, textColor: .GrayScale.gray900) - } - .padding(.bottom, 6) - MyInformationView(title: "이름", content: viewModel.name) - MyInformationView(title: "생년월일", content: viewModel.birthDay) - MyInformationView(title: "학년 반 번호", content: viewModel.gradeClassNum) MyInformationView(title: "아이디", content: viewModel.id) + MyInformationView(title: "생년월일", content: viewModel.birthDay) + Spacer() Button(action: { viewModel.showLogoutAlert = true }, label: { @@ -39,12 +33,8 @@ struct MyPageView: View { .background(Color.System.red50) .cornerRadius(8) }) - Spacer() + .padding(.bottom, 40) } - .sdPhotoPicker( - isPresented: $viewModel.xPhotosIsPresented, - selection: $viewModel.profileImage - ) .sdAlert(isPresented: $viewModel.showLogoutAlert) { SDAlert( title: "정말 회원탈퇴 하시겠습니까?", @@ -55,6 +45,10 @@ struct MyPageView: View { }) ) } + .sdPhotoPicker( + isPresented: $viewModel.xPhotosIsPresented, + selection: $viewModel.profileImage + ) .onChange(of: viewModel.profileImage, perform: { _ in viewModel.uploadImage() }) diff --git a/Application/Sources/Scene/MyPage/MyProfile/MyProfileView.swift b/Application/Sources/Scene/MyPage/MyProfile/MyProfileView.swift new file mode 100644 index 00000000..6f5a720d --- /dev/null +++ b/Application/Sources/Scene/MyPage/MyProfile/MyProfileView.swift @@ -0,0 +1,36 @@ +import SwiftUI + +import SemicolonDesign + +struct MyProfileView: View { + var imageUrl: URL? + @Binding var uiimage: UIImage + var name: String + var gradeClassNum: String + @Binding var xPhotosIsPresented: Bool + var body: some View { + HStack(alignment: .center, spacing: 16) { + ZStack(alignment: .bottomTrailing) { + ProfileImageView( + imageUrl: imageUrl, + uiimage: $uiimage + ) + Image.camera + .resizable() + .scaledToFill() + .frame(width: 20, height: 20) + }.onTapGesture { + xPhotosIsPresented = true + } + VStack(alignment: .leading, spacing: 0) { + Text(name) + .sdText(type: .body1, textColor: .GrayScale.gray900) + Text(gradeClassNum) + .sdText(type: .body2, textColor: .GrayScale.gray900) + } + Spacer() + } + .padding(.bottom, 20) + .padding(.leading, 4) + } +} diff --git a/Application/Sources/Scene/MyPage/ProfileImage/ProfileImageView.swift b/Application/Sources/Scene/MyPage/MyProfile/ProfileImage/ProfileImageView.swift similarity index 90% rename from Application/Sources/Scene/MyPage/ProfileImage/ProfileImageView.swift rename to Application/Sources/Scene/MyPage/MyProfile/ProfileImage/ProfileImageView.swift index c965c4b2..26979ebd 100644 --- a/Application/Sources/Scene/MyPage/ProfileImage/ProfileImageView.swift +++ b/Application/Sources/Scene/MyPage/MyProfile/ProfileImage/ProfileImageView.swift @@ -10,19 +10,18 @@ struct ProfileImageView: View { image .resizable() .scaledToFill() + .frame(width: 60, height: 60) } placeholder: { Image("DefaultImage") } .frame(width: 60, height: 60) .cornerRadius(30) - .padding(.bottom, 6) } else { Image(uiImage: uiimage) .resizable() .scaledToFill() .frame(width: 60, height: 60) .cornerRadius(30) - .padding(.bottom, 6) } } }