-
Notifications
You must be signed in to change notification settings - Fork 117
[Woo POS] Add totals view. Shuffle views on checkout flow #12809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.padding(.all, 10) | ||
.frame(maxWidth: .infinity, idealHeight: 120) | ||
.font(.title) | ||
.foregroundColor(Color.primaryBackground) | ||
.background(Color.white) | ||
Button("Card") { debugPrint("Not implemented") } | ||
.padding(.all, 10) | ||
.frame(maxWidth: .infinity, idealHeight: 120) | ||
.font(.title) | ||
.foregroundColor(Color.primaryBackground) | ||
.background(Color.white) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since most likely we'll share button styling in the POS, even if is not final, I think we can start to extract those and add more ButtonStyle
s to /ReusableViews
?
|
Text("Totals") | ||
.font(.title) | ||
.foregroundColor(Color.white) | ||
ForEach(viewModel.productsInCart, id: \.product.productID) { cartProduct in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Embed in ScrollView?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup yup! 6997ec8
.background(Color.secondaryBackground) | ||
.frame(maxWidth: .infinity) | ||
Spacer() | ||
CartView(viewModel: viewModel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can extract this CartView and its setup into private var:
private var cartView: some View {
CartView(viewModel: viewModel)
.background(Color.secondaryBackground)
.frame(maxWidth: .infinity)
}
You can do same thing with TotalsView and ProductGridView and just use those vars here in switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I've moved all subviews to variables on e5b9f11
.foregroundColor(.white) | ||
} | ||
Spacer() | ||
HStack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, this only happens in landscape so I missed it. Fixed on 4896b7f
…4-pos-checkout-view-shuffle
Partially addresses #12763
Closes: #12764
This PR adds a initial
Totals
view, and shuffles the order of the different views depending if we'rebuilding
orfinalizing
checkout. Most likely the view style will change, so I haven't taken much time with the UI details (eg: "Take payment" most likely will be removed or not be a button)Description
Changes
TotalsView
. At the moment this just renders a list of products in-cart, and three buttons at the bottom for payment collectionOrderStage
enum that indicates where in the process are we,building
orfinalizing
.Testing instructions
Checkout
Add More
building
and cart state is updated