From 9cceada4f97f8cdf51a9bdeb6f852c36c2ea0b5d Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Fri, 15 Sep 2023 08:38:32 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat=20::=20=EA=B3=B5=EB=B0=B1=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Recruitment/Components/RecruitmentListCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Feature/RecruitmentFeature/Sources/Recruitment/Components/RecruitmentListCell.swift b/Projects/Feature/RecruitmentFeature/Sources/Recruitment/Components/RecruitmentListCell.swift index 1ab0aeaf..e617885c 100644 --- a/Projects/Feature/RecruitmentFeature/Sources/Recruitment/Components/RecruitmentListCell.swift +++ b/Projects/Feature/RecruitmentFeature/Sources/Recruitment/Components/RecruitmentListCell.swift @@ -31,7 +31,7 @@ struct RecruitmentListCell: View { HStack(spacing: 12) { URLImage(imageURL: recruitmentEntity.companyProfileURL, shape: .square(80)) .cornerRadius(15) - .padding(8) + .padding(8) VStack(alignment: .leading, spacing: 4) { Text(recruitmentEntity.jobCodeList) From b85678db26a2652cceaad13a6604b4e6ac74637e Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Fri, 15 Sep 2023 10:26:51 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat=20::=20=ED=9A=8C=EC=9B=90=20=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/MyPage/MyPageView.swift | 22 ++++++++++++++++++- .../Sources/MyPage/MyPageViewModel.swift | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageView.swift b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageView.swift index e50d0685..b8ad41bb 100644 --- a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageView.swift +++ b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageView.swift @@ -113,6 +113,12 @@ struct MyPageView: View { } Divider().foregroundColor(.Sub.gray40) + + myPageNavigateCell(title: "회원탈퇴", color: .State.error) { + viewModel.isPresentedWithdraw.toggle() + } + + Divider().foregroundColor(.Sub.gray40) } } .padding(.horizontal, 25) @@ -131,7 +137,7 @@ struct MyPageView: View { when: $viewModel.isNavigateChangePassword ) .imagePicker(isShow: $viewModel.isShowImagePicker, uiImage: $viewModel.image) - .jobisToast(isShowing: $viewModel.isErrorOcuured, message: "프로필 변경에 실패했습니다.", style: .error) + .jobisToast(isShowing: $viewModel.isErrorOcuured, message: viewModel.errorMessage, style: .error) .onChange(of: viewModel.isTabbarHidden) { newValue in withAnimation { tabbarHidden.wrappedValue = newValue @@ -166,6 +172,20 @@ struct MyPageView: View { ) ) } + .alert(isPresented: $viewModel.isPresentedWithdraw) { + Alert( + title: Text("회원탈퇴"), + message: Text("탈퇴를 한 번 진행하시면 되돌릴 수 없습니다.\n정말 탈퇴를 하시겠습니까?"), + primaryButton: Alert.Button.destructive( + Text("확인"), + action: { + } + ), + secondaryButton: Alert.Button.cancel( + Text("취소") + ) + ) + } } @ViewBuilder diff --git a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageViewModel.swift b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageViewModel.swift index 39691bd5..3b3c1a61 100644 --- a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageViewModel.swift +++ b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageViewModel.swift @@ -14,6 +14,7 @@ final class MyPageViewModel: BaseViewModel { @Published var isShowFieldOfInterest = false @Published var isNavigateChangePassword = false @Published var isPresentedLogoutAlert = false + @Published var isPresentedWithdraw = false @Published var isSuccessLogout = false @Published var isShowImagePicker = false @Published var image: UIImage? From 3d92121cd926d33bb56f1cf2ac55706ae4a6005c Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Fri, 15 Sep 2023 10:27:06 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat=20::=20=ED=9A=8C=EC=82=AC=20=EC=84=A4?= =?UTF-8?q?=EB=AA=85=20=EC=95=88=EC=9D=B4=EB=BB=90=EC=84=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Detail/FindCompanyDetailView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Projects/Feature/FindCompanyFeature/Sources/Detail/FindCompanyDetailView.swift b/Projects/Feature/FindCompanyFeature/Sources/Detail/FindCompanyDetailView.swift index d6069b04..2303544d 100644 --- a/Projects/Feature/FindCompanyFeature/Sources/Detail/FindCompanyDetailView.swift +++ b/Projects/Feature/FindCompanyFeature/Sources/Detail/FindCompanyDetailView.swift @@ -122,8 +122,9 @@ struct FindCompanyDetailView: View { @ViewBuilder func companyIntroduce(introduce: String) -> some View { - VStack(spacing: 5) { + VStack(alignment: .leading, spacing: 5) { Text(introduce) + .multilineTextAlignment(.leading) .lineLimit( isShowDetail ? nil : introduce.count > 200 ? 3 : nil ) @@ -142,8 +143,8 @@ struct FindCompanyDetailView: View { isShowDetail.toggle() } } + .frame(maxWidth: .infinity) } } - .frame(maxWidth: .infinity) } } From 407d80054a2b368ca8d05eeda2851883fcf689a3 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Fri, 15 Sep 2023 10:27:26 +0900 Subject: [PATCH 4/4] fix :: if let -> guard let --- .../FindCompany/FindCompanyViewModel.swift | 13 +++++------ .../Recruitment/RecruitmentViewModel.swift | 23 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Projects/Feature/FindCompanyFeature/Sources/FindCompany/FindCompanyViewModel.swift b/Projects/Feature/FindCompanyFeature/Sources/FindCompany/FindCompanyViewModel.swift index 2a1328a7..b8ad82a4 100644 --- a/Projects/Feature/FindCompanyFeature/Sources/FindCompany/FindCompanyViewModel.swift +++ b/Projects/Feature/FindCompanyFeature/Sources/FindCompany/FindCompanyViewModel.swift @@ -27,13 +27,12 @@ final class FindCompanyViewModel: BaseViewModel { } func appendFindCompanyList(list: CompanyEntity) { - if self.studentCompanyList?.companies.last == list { - listPage += 1 - addCancellable( - fetchStudentCompanyListUseCase.execute(page: listPage, name: nil) - ) { [weak self] studentCompanyList in - self?.studentCompanyList?.companies.append(contentsOf: studentCompanyList.companies) - } + guard self.studentCompanyList?.companies.last == list else { return } + listPage += 1 + addCancellable( + fetchStudentCompanyListUseCase.execute(page: listPage, name: nil) + ) { [weak self] studentCompanyList in + self?.studentCompanyList?.companies.append(contentsOf: studentCompanyList.companies) } } } diff --git a/Projects/Feature/RecruitmentFeature/Sources/Recruitment/RecruitmentViewModel.swift b/Projects/Feature/RecruitmentFeature/Sources/Recruitment/RecruitmentViewModel.swift index 1efa5f9a..426f0b69 100644 --- a/Projects/Feature/RecruitmentFeature/Sources/Recruitment/RecruitmentViewModel.swift +++ b/Projects/Feature/RecruitmentFeature/Sources/Recruitment/RecruitmentViewModel.swift @@ -75,23 +75,22 @@ final class RecruitmentViewModel: BaseViewModel { } func appendRecruitmentList(list: RecruitmentEntity) { + guard self.recruitmentList?.recruitments.last == list else { return } var jobCode: String? { guard let selectedJobCode = selectedJobCode?.code else { return nil } return String(selectedJobCode) } - if self.recruitmentList?.recruitments.last == list { - listPage += 1 - addCancellable( - fetchRecruitmentListUseCase.execute( - page: listPage, - jobCode: jobCode, - techCode: selectedTechCode.map { String($0.code) }, - name: companyText.isEmpty ? nil : companyText - ) - ) { [weak self] recruitmentList in - self?.recruitmentList?.recruitments.append(contentsOf: recruitmentList.recruitments) - } + listPage += 1 + addCancellable( + fetchRecruitmentListUseCase.execute( + page: listPage, + jobCode: jobCode, + techCode: selectedTechCode.map { String($0.code) }, + name: companyText.isEmpty ? nil : companyText + ) + ) { [weak self] recruitmentList in + self?.recruitmentList?.recruitments.append(contentsOf: recruitmentList.recruitments) } }