-
Notifications
You must be signed in to change notification settings - Fork 111
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
[Shipping Labels - Customs Form] UI 2 #14769
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
…github.com/woocommerce/woocommerce-ios into issue/13784-shipping-labels-customs-form-2
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.
This is looking good! I noticed some minor issues to address, mostly to match the designs.
VStack { | ||
ScrollViewReader { proxy in | ||
ScrollView { | ||
VStack(alignment: .leading, spacing: Constants.defaultVerticalSpacing) { |
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.
That's true, I fixed it in 78df820
} | ||
}.renderedIf(isCollapsed) | ||
.foregroundColor(.primary) | ||
.subheadlineStyle() |
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.
Is this text supposed to be subheadline style? The design looks like it's using regular text styling here.
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! Fixed here bee9058
} | ||
.padding(.top, Layout.collapsibleViewTopPadding) | ||
}, content: { | ||
VStack(alignment: .leading, spacing: Layout.collapsibleViewVerticalSpacing) { |
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.
Similar to above, it looks like there's extra space between the labels and their corresponding text field/dropdown menu in this view, compared to the design.
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 point, done in 111bf7b
.foregroundColor(.primary) | ||
.subheadlineStyle() | ||
Spacer() | ||
Image(systemName: "info.circle") |
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.
Is this info circle supposed to be a button?
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.
Indeed, done in 71cd530
value: "Description", | ||
comment: "Title for the customs items description text field for customs items") | ||
static let HSTarriffNumber = NSLocalizedString("wooShipping.customsItems.hsTarriffNumber", | ||
value: "HSTarriffNumber", |
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.
This is missing its spaces, and I think there's a typo in the design. It should be:
value: "HSTarriffNumber", | |
value: "HS tariff number", |
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.
value: "Optional", | ||
comment: "Placeholder for the HS Tarriff Number text field for customs items") | ||
static let HSTarriffNumberMoreInfo = NSLocalizedString("wooShipping.customsItems.hsTarriffNumber.moreInfoText", | ||
value: "More info about HS tarriff", |
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.
I think there's a typo for this string in the design:
value: "More info about HS tarriff", | |
value: "More info about HS tariff", |
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.
Done in f1f3cc6
.footnoteStyle() | ||
} | ||
|
||
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 point, done in 4ae10d7
// TODO: Add right unit | ||
Text("kg") |
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.
FYI the weight unit is set as an environment value, so you could access it with a property like @Environment(\.shippingWeightUnit) var weightUnit: String
in this view.
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.
Awesome, thanks for the hint, added here 2456a91
.padding(.trailing, Layout.extraPadding) | ||
.padding(.bottom, Layout.extraPadding) | ||
}) | ||
.roundedBorder(cornerRadius: Layout.borderCornerRadius, lineColor: Color(.separator), lineWidth: Layout.borderLineWidth) |
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.
According to the design, the border around the collapsible view could be grey (when collapsed), red (when collapsed if there's an issue with the item), or purple (when expanded).
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! Done in 1215505
|
||
let allCountries: [Country] | ||
|
||
let hsTariffURL: URL? = .init(string: "https://woocommerce.com/document/woocommerce-shipping-and-tax/woocommerce-shipping/#section-29") |
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.
Should we add this to WooConstants.URLs
since it's a known/trusted URL?
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.
Indeed, it looks much better there 00c7eb6
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.
🚀
Part of: #13784
Description
With this PR we implement the second part of the Shipping Labels Customs forms: the Product Details and the button to save the Custom Details. Please note that we don't implement any data binding here.
Steps to reproduce
Testing information
N/A
Screenshots
Simulator.Screen.Recording.-.iPhone.16.-.2024-12-27.at.11.25.22.mp4
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: