Skip to content

Commit

Permalink
DON-384: Adjust the TextField of the Place Selector GC (#1931)
Browse files Browse the repository at this point in the history
* DON-384: Adjust the TextField of the Place Selector GC [change default icon, update placeholder colour, hide a close button if it's empty]

* Record snapshots

* Fix hiding logic

* Record snapshots

* Updated snapshots

* Fix icon in BPKAppSearchModalTests

---------

Co-authored-by: Yura Reutskiy <yurareutskiy@skyscanner.net>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 5, 2024
1 parent 1ebfb99 commit c40ae7a
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 1 deletion.
Expand Up @@ -58,7 +58,7 @@ public struct BPKSearchInputSummary: View {
HStack(spacing: .md) {
prefixView
.accessibilityHidden(true)
TextField(placeholder, text: $text)
TextField(placeholder, text: $text, prompt: placeholderView)
.font(style: .bodyDefault)
.foregroundColor(state.textColor)
.disabled(state.isDisabled)
Expand All @@ -82,6 +82,7 @@ public struct BPKSearchInputSummary: View {
BPKIconView(icon.icon)
.foregroundColor(icon.color)
}
.opacity(text.isEmpty ? 0.0 : 1.0)
.accessibilityElement(children: .ignore)
.accessibilityLabel(accessibilityLabel)
.accessibilityAddTraits(.isButton)
Expand All @@ -93,6 +94,12 @@ public struct BPKSearchInputSummary: View {
}
}

@ViewBuilder
private var placeholderView: Text {
Text(placeholder)
.foregroundColor(Color(BPKColor.textSecondaryColor.value))
}

@ViewBuilder
private var prefixView: some View {
switch inputPrefix {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c40ae7a

Please sign in to comment.