Skip to content

Commit

Permalink
Merge pull request #1200 from HedvigInsurance/fix/edit-coinsured/dism…
Browse files Browse the repository at this point in the history
…issing-view-on-canceleing-edit-single-co-insured

Edit co insured journey
  • Loading branch information
sladan-hedvig authored Jan 24, 2024
2 parents 4a5e4af + 66784f5 commit ef61f07
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Projects/EditCoInsured/Sources/Journeys/EditCoInsuredJourney.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class EditCoInsuredJourney {
getScreen(for: action)
}
.configureTitle(L10n.coinsuredEditTitle)
.withJourneyDismissButton
.addDismissEditCoInsuredFlow()
}

static func openNewInsuredPeopleScreen(config: InsuredPeopleConfig) -> some JourneyPresentation {
Expand All @@ -63,7 +63,7 @@ public class EditCoInsuredJourney {
getScreen(for: action)
}
.configureTitle(L10n.coinsuredEditTitle)
.withJourneyDismissButton
.addDismissEditCoInsuredFlow()
}

@JourneyBuilder
Expand Down Expand Up @@ -263,11 +263,7 @@ public class EditCoInsuredJourney {
style: .detented(.scrollViewContentSize),
options: [.largeNavigationBar, .blurredBackground]
) { action in
if case .coInsuredNavigationAction(action: .dismissEdit) = action {
PopJourney()
} else {
getScreen(for: action)
}
getScreen(for: action)
}
.configureTitle(L10n.SelectInsurance.NavigationBar.CenterElement.title)
}
Expand Down Expand Up @@ -335,3 +331,14 @@ public class EditCoInsuredJourney {
}
}
}

extension JourneyPresentation {
func addDismissEditCoInsuredFlow() -> some JourneyPresentation {
self.withJourneyDismissButtonWithConfirmation(
withTitle: L10n.General.areYouSure,
andBody: L10n.Claims.Alert.body,
andCancelText: L10n.General.no,
andConfirmText: L10n.General.yes
)
}
}

0 comments on commit ef61f07

Please sign in to comment.