Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
merege :: (#160) recruitment bug
Browse files Browse the repository at this point in the history
merege :: (#160) recruitment bug
  • Loading branch information
HongSJae authored Sep 15, 2023
2 parents bb6bd00 + 407d800 commit f5e6ddc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -142,8 +143,8 @@ struct FindCompanyDetailView: View {
isShowDetail.toggle()
}
}
.frame(maxWidth: .infinity)
}
}
.frame(maxWidth: .infinity)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
22 changes: 21 additions & 1 deletion Projects/Feature/MyPageFeature/Sources/MyPage/MyPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit f5e6ddc

Please sign in to comment.