File tree Expand file tree Collapse file tree 5 files changed +14
-3
lines changed
Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
9090 return buildConfig == . localDeveloper || buildConfig == . alpha
9191 case . paymentsOnboardingInPointOfSale:
9292 return buildConfig == . localDeveloper
93+ case . displayInfiniteScrollingUIDetailsInPointOfSale:
94+ return buildConfig == . localDeveloper || buildConfig == . alpha
9395 default :
9496 return true
9597 }
Original file line number Diff line number Diff line change @@ -196,4 +196,8 @@ public enum FeatureFlag: Int {
196196 /// Supports Woo Payments onboarding in POS so that merchants who have not completed onboarding can access POS.
197197 ///
198198 case paymentsOnboardingInPointOfSale
199+
200+ /// Enables UI-related aspects of infinite scrolling in POS. It does not affect the actual infinite scrolling behaviour.
201+ ///
202+ case displayInfiniteScrollingUIDetailsInPointOfSale
199203}
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ private extension ItemListView {
131131 } )
132132 }
133133 GhostItemCardView ( )
134- . renderedIf ( viewModel. state == . loading)
134+ . renderedIf ( viewModel. shouldShowGhostableItemCard && viewModel . state == . loading)
135135 }
136136 . padding ( . bottom, floatingControlAreaSize. height)
137137 . padding ( . horizontal, Constants . itemListPadding)
Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ struct PointOfSaleEntryPointView: View {
2626 currencyFormatter: currencyFormatter,
2727 paymentState: . acceptingCard)
2828 let cartViewModel = CartViewModel ( analytics: analytics)
29- let itemListViewModel = ItemListViewModel ( itemProvider: itemProvider)
29+
30+ let shouldShowGhostableItemCard = ServiceLocator . featureFlagService. isFeatureFlagEnabled ( . displayInfiniteScrollingUIDetailsInPointOfSale)
31+ let itemListViewModel = ItemListViewModel ( itemProvider: itemProvider, shouldShowGhostableItemCard: shouldShowGhostableItemCard)
3032
3133 self . _viewModel = StateObject ( wrappedValue: PointOfSaleDashboardViewModel (
3234 cardPresentPaymentService: cardPresentPaymentService,
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ final class ItemListViewModel: ItemListViewModelProtocol {
1212
1313 @Published private var currentPage : Int = Constants . initialPage
1414
15+ private( set) var shouldShowGhostableItemCard : Bool = false
16+
1517 var shouldShowHeaderBanner : Bool {
1618 // The banner it's shown as long as it hasn't already been dismissed once:
1719 if UserDefaults . standard. bool ( forKey: BannerState . isSimpleProductsOnlyBannerDismissedKey) == true {
@@ -28,8 +30,9 @@ final class ItemListViewModel: ItemListViewModelProtocol {
2830 var itemsPublisher : Published < [ POSItem ] > . Publisher { $items }
2931 var statePublisher : Published < ItemListViewModel . ItemListState > . Publisher { $state }
3032
31- init ( itemProvider: POSItemProvider ) {
33+ init ( itemProvider: POSItemProvider , shouldShowGhostableItemCard : Bool = false ) {
3234 self . itemProvider = itemProvider
35+ self . shouldShowGhostableItemCard = shouldShowGhostableItemCard
3336 selectedItemPublisher = selectedItemSubject. eraseToAnyPublisher ( )
3437 }
3538
You can’t perform that action at this time.
0 commit comments