Skip to content

Commit

Permalink
Fixed issue with not showing datepicker in the termination flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sladan-hedvig committed Jan 28, 2025
1 parent e50e40f commit bbaafab
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
53 changes: 25 additions & 28 deletions Projects/TerminateContracts/Sources/Views/SetTerminationDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,35 @@ struct SetTerminationDate: View {
}

var body: some View {
hForm {
if let termination = terminationNavigationVm.terminationDateStepModel {
DatePickerView(
vm: .init(
continueAction: {
terminationNavigationVm.terminationDateStepModel?.date = terminationDate
terminationNavigationVm.isDatePickerPresented = false
if let termination = terminationNavigationVm.terminationDateStepModel {
DatePickerView(
vm: .init(
continueAction: {
terminationNavigationVm.terminationDateStepModel?.date = terminationDate
terminationNavigationVm.isDatePickerPresented = false

DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.isHidden = true
}
},
cancelAction: {
terminationNavigationVm.isDatePickerPresented = false
},
date: $terminationDate,
config: .init(
minDate: termination.minDate.localDateToDate,
maxDate: termination.maxDate.localDateToDate,
initialySelectedValue: Date(),
placeholder: "",
title: L10n.terminationDateText,
showAsList: false,
dateFormatter: .none,
buttonText: L10n.generalSaveButton
)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.isHidden = true
}
},
cancelAction: {
terminationNavigationVm.isDatePickerPresented = false
},
date: $terminationDate,
config: .init(
minDate: termination.minDate.localDateToDate,
maxDate: termination.maxDate.localDateToDate,
initialySelectedValue: Date(),
placeholder: "",
title: L10n.terminationDateText,
showAsList: false,
dateFormatter: .none,
buttonText: L10n.generalSaveButton
)
)
}
)
.hide($isHidden)
}
.hFormContentPosition(.compact)
.hide($isHidden)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct SetTerminationDateLandingScreen: View {
.foregroundColor(hTextColor.Opaque.secondary)
}
}

.fixedSize(horizontal: false, vertical: true)
HStack {
hRow {
hText(L10n.terminationFlowIUnderstandText)
Expand Down
1 change: 1 addition & 0 deletions Projects/hCoreUI/Sources/Views/GeneralDatePicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public struct DatePickerView: View {
}
.sectionContainerStyle(.transparent)
}
.padding(.top, .padding8)
}
.toolbar {
ToolbarItem(placement: .principal) {
Expand Down

0 comments on commit bbaafab

Please sign in to comment.