Skip to content
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

[Woo POS] Add simple-only product banner to dashboard #13319

Merged
merged 8 commits into from
Jul 16, 2024

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Jul 15, 2024

Closes: #13317

Description

This PR adds a toggeable banner to the header of the item list view, in order to the current POS constraint for simple products only.

Please note the UI is not final yet, so we haven't addressed the fine-tuned details, just the overall view and its behaviour. In future PRs we also want to tie the banner display to once per app-install, at the moment will just appear all the time by default on init.

Initial Collapsed
Simulator Screenshot - iPad Pro (12 9-inch) (6th generation) - 2024-07-15 at 18 05 02 Simulator Screenshot - iPad Pro (12 9-inch) (6th generation) - 2024-07-15 at 18 05 05

Testing

  • In POS mode
  • Observe the banner appearing at the top of the product list
  • Tap the x icon and observe it collapses. Tap the i icon and observe it expands again.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 15, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr13319-196451f
Version19.5
Bundle IDcom.automattic.alpha.woocommerce
Commit196451f
App Center BuildWooCommerce - Prototype Builds #10001
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: POS labels Jul 15, 2024
@iamgabrielma iamgabrielma added this to the 19.6 milestone Jul 15, 2024
@iamgabrielma iamgabrielma marked this pull request as ready for review July 15, 2024 11:10
@@ -37,6 +34,63 @@ struct ItemListView: View {
/// View Helpers
///
private extension ItemListView {
@ViewBuilder
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on using ViewBuilder vs computed variables for the views? I tend to use the first one if there's some conditional logic or we need to pass params, but doesn't seem to be needed for all cases 🤔

Copy link
Contributor

@bozidarsevo bozidarsevo Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put @ViewBuilder for both functions and computed variables

Comment on lines 69 to 70
}
VStack {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would insert a Spacer here between the text and the close button to make sure that the button is pushed on the right side and text and all the content on the left is pushed on the left:

Simulator Screenshot - iPad Pro (11-inch) (4th generation) 17 2 - 2024-07-15 at 13 58 59

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Updated dc3bc34

.background(Color.posBackgroundWhitei3)
}

var headertextView: some View {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: headerTextView

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: f62db85

var headertextView: some View {
Text(Localization.productSelectorTitle)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.vertical, 8)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can also have this 8 in Constants

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Moved on 196451f

@iamgabrielma iamgabrielma merged commit c70156d into trunk Jul 16, 2024
22 checks passed
@iamgabrielma iamgabrielma deleted the issue/13317-pos-simple-product-banner branch July 16, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: POS type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] M2: Simple products only banner
3 participants