File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
ViewModels/Booking Details
ViewRelated/Bookings/Booking Details Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,14 @@ extension BookingDetailsViewModel {
327327 }
328328}
329329
330+ // MARK: Navigation
331+
332+ extension BookingDetailsViewModel {
333+ func navigateToOrderDetails( ) {
334+ MainTabBarController . navigateToOrderDetails ( with: booking. orderID, siteID: booking. siteID)
335+ }
336+ }
337+
330338private extension BookingDetailsViewModel {
331339 static func navigationTitle( for booking: Booking ) -> String {
332340 let titleFormat = NSLocalizedString (
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ struct BookingDetailsView: View {
6464 print ( " On mark as paid tap " )
6565 }
6666 Button ( Localization . viewOrder) {
67- print ( " On view order tap " )
67+ viewModel . navigateToOrderDetails ( )
6868 }
6969 Button ( Localization . cancelBookingAction, role: . destructive) {
7070 print ( " On cancel booking tap " )
@@ -217,7 +217,11 @@ private extension BookingDetailsView {
217217 VStack ( alignment: . leading, spacing: Layout . contentVerticalPadding) {
218218 ForEach ( content. actions) { action in
219219 Button {
220- /// On action tap
220+ if action == . viewOrder {
221+ viewModel. navigateToOrderDetails ( )
222+ } else {
223+ /// On action tap
224+ }
221225 } label: {
222226 Text ( action. buttonTitle)
223227 }
You can’t perform that action at this time.
0 commit comments