-
Notifications
You must be signed in to change notification settings - Fork 33
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
DON-384: Adjust place selector text field #1923
DON-384: Adjust place selector text field #1923
Conversation
…shots in light mode]
3af3065
to
6de7a46
Compare
@@ -54,14 +66,16 @@ class BPKAppSearchModalTests: XCTestCase { | |||
// MARK: - Helpers | |||
private func givenSut( | |||
with results: BPKAppSearchModalResults, | |||
inputState: BPKAppSearchModal.TextFieldState = .default | |||
inputState: BPKAppSearchModal.TextFieldState = .default, | |||
prefixState: BPKTextField.PrefixState? = nil |
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.
@yurareutskiy the test fails to compile on this line. The naming has probably changed.
This is also the reason the analyze step fails.
Once the tests run again, push an empty commit with Record snapshots
to have CI take the snapshots for you. (If the snapshot test fails :D)
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.
Thanks! Still not sure why it was failing before I renamed that, but amazing as it's working:)
Snapshots were updated. Please verify the changes match the expected layout.
|
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.
Can you make a recording how the prefix sounds with a screen reader? :D
…dd screenshots, fix a layout based on feedback]
public struct BPKSearchInputSummary: View { | ||
public enum InputPrefix { | ||
case text(String) | ||
case icon |
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 should receive a BPKIcon as parameter, so that clients can define what icon they use (clients of this component may be within backpack, but at least it would be configurable from outside this very component)
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.
hmm, that's a good idea I guess to make it more flexible
.onAppear { | ||
inputFieldIsFocussed.toggle() | ||
} |
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'm not sure we want this within the component, for example, hotels does not want this. it should be removed from here and leave it up to the clients defining this
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.
(if this is something you want to have)
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.
yeah, 100% should be removed 😅
} | ||
|
||
public var body: some View { | ||
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.
Please specify spacing here using bpk tokens, like so:
HStack { | |
HStack(spacing: .md) { |
BPKText(prefixText, style: .bodyDefault) | ||
.foregroundColor(.textSecondaryColor) | ||
case .icon: | ||
BPKIconView(BPKIcon(name: "search")) |
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.
the icon should be passed by the ones using this component, shouldnt be hardcoded within. also, you should use the constant for the icon rather than a string for it
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.
Looks good over all! just a couple of small modifications I think would be good to have
…ty to customise an icon for the prefix; remove testing code;]
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.
Looks pretty good!! thanks for contributing!!
Snapshots were updated. Please verify the changes match the expected layout.
|
} else { | ||
BPKIconView(icon.icon) | ||
.foregroundColor(icon.color) | ||
.accessibilityHidden(true) |
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.
👍
.focused($focused) | ||
accessory | ||
} | ||
.padding(.md) |
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.
Based on the design I think the padding is:
.padding(.left, .base)
.padding(.right, .md)
.padding(.vertical, .md)
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 thin it's actually .padding(.horizontal, .base).padding(.vertical, BPKSpacing.md.value + BPKSpacing.sm.value)
(we don't have a token for value 12 hehe) could you raise the pr so I can approve it myself?
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.
Figma link
inputPrefix
which will allow us to set an additional visual enhancement for different verticals and their place selectors.inputPrefix
can be in two state: icon, customTextRemember to include the following changes:
README.md
Backpack.h
header fileIf you are curious about how we review, please read through the code review guidelines