From 797ea6bd9cb513396527f82a5c4298d98b62ab43 Mon Sep 17 00:00:00 2001 From: Alexander Kauer Date: Sun, 25 Feb 2024 13:25:10 +0100 Subject: [PATCH] Comments cleanup --- WaiterRobot/Ui/Billing/BillingScreen.swift | 1 + WaiterRobot/Ui/Core/FloatingActionButton.swift | 2 +- WaiterRobot/Ui/Core/Navigation.swift | 2 +- WaiterRobot/Ui/Order/OrderListItem.swift | 1 + WaiterRobot/Ui/Order/Search/ProductSearch.swift | 10 ++++------ WaiterRobot/Ui/TableDetail/TableDetailScreen.swift | 10 +--------- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/WaiterRobot/Ui/Billing/BillingScreen.swift b/WaiterRobot/Ui/Billing/BillingScreen.swift index e868993..90b233a 100644 --- a/WaiterRobot/Ui/Billing/BillingScreen.swift +++ b/WaiterRobot/Ui/Billing/BillingScreen.swift @@ -61,6 +61,7 @@ struct BillingScreen: View { } } } + // TODO: make only half screen when ios 15 is dropped .sheet(isPresented: $showPayDialog) { PayDialog(viewModel: viewModel) } diff --git a/WaiterRobot/Ui/Core/FloatingActionButton.swift b/WaiterRobot/Ui/Core/FloatingActionButton.swift index 5a093f6..ff84a7e 100644 --- a/WaiterRobot/Ui/Core/FloatingActionButton.swift +++ b/WaiterRobot/Ui/Core/FloatingActionButton.swift @@ -45,7 +45,7 @@ struct FloatingActionButton: View { Image(systemName: icon) .imageScale(.large) .foregroundColor(.white) - // .fontWeight(.semibold) // TODO enable when dropped ios 15 + // .fontWeight(.semibold) // TODO: enable when dropped ios 15 } } .buttonStyle(FloatingActionButtonStyle()) diff --git a/WaiterRobot/Ui/Core/Navigation.swift b/WaiterRobot/Ui/Core/Navigation.swift index cae727f..d9d8976 100644 --- a/WaiterRobot/Ui/Core/Navigation.swift +++ b/WaiterRobot/Ui/Core/Navigation.swift @@ -38,7 +38,7 @@ extension View { if let icon { HStack { Image(systemName: icon) - // .fontWeight(.semibold) // TODO enable when dropped iOS15 + // .fontWeight(.semibold) // TODO: enable when dropped iOS15 } .padding(.trailing, 4) } diff --git a/WaiterRobot/Ui/Order/OrderListItem.swift b/WaiterRobot/Ui/Order/OrderListItem.swift index 3586aed..b8d3b8b 100644 --- a/WaiterRobot/Ui/Order/OrderListItem.swift +++ b/WaiterRobot/Ui/Order/OrderListItem.swift @@ -40,6 +40,7 @@ struct OrderListItem: View { } .foregroundColor(.blackWhite) } + // TODO: make only half screen when ios 15 is dropped .sheet(isPresented: $editNote) { NavigationView { VStack { diff --git a/WaiterRobot/Ui/Order/Search/ProductSearch.swift b/WaiterRobot/Ui/Order/Search/ProductSearch.swift index 81ffb98..20d9ec3 100644 --- a/WaiterRobot/Ui/Order/Search/ProductSearch.swift +++ b/WaiterRobot/Ui/Order/Search/ProductSearch.swift @@ -16,15 +16,13 @@ struct ProductSearch: View { var body: some View { NavigationView { switch onEnum(of: viewModel.state.productGroups) { - case let .loading(resource): + case .loading: ProgressView() case let .error(resource): - productGroupsError() + productGroupsError(error: resource) case let .success(resource): if let productGroups = resource.data { productsGroupsList(productGroups: productGroups) - } else { - productGroupsError() } } } @@ -88,8 +86,8 @@ struct ProductSearch: View { } } - private func productGroupsError() -> some View { - Text("Something went wrong") // TODO: fix + private func productGroupsError(error: ResourceError>) -> some View { + Text(error.userMessage) } private func getGroupNames(_ productGroups: [ProductGroup]) -> [String] { diff --git a/WaiterRobot/Ui/TableDetail/TableDetailScreen.swift b/WaiterRobot/Ui/TableDetail/TableDetailScreen.swift index 0f4ac8e..61afaf1 100644 --- a/WaiterRobot/Ui/TableDetail/TableDetailScreen.swift +++ b/WaiterRobot/Ui/TableDetail/TableDetailScreen.swift @@ -21,6 +21,7 @@ struct TableDetailScreen: View { .handleSideEffects(of: viewModel, navigator) } + // TODO: add refreshing and loading indicator (also check android) private func content() -> some View { VStack { switch onEnum(of: viewModel.state.orderedItemsResource) { @@ -38,15 +39,6 @@ struct TableDetailScreen: View { } } } - - // TODO: add refreshing and loading indicator (also check android) - // ZStack { - // tableDetails() - // - // EmbeddedFloatingActionButton(icon: "plus") { - // viewModel.actual.openOrderScreen(initialItemId: nil) - // } - // } } func tableDetails(orderedItems: [OrderedItem]) -> some View {