Skip to content

Commit

Permalink
LMN-775: Add entity type in place selector (#1808)
Browse files Browse the repository at this point in the history
* add type for bpk session in app search modal

* Updated snapshots for 'dm'

* Updated snapshots for 'rtl'

* Updated snapshots for 'default'

* fix to more standard and simplification

* Updated snapshots for 'rtl'

* Updated snapshots for 'default'

* Updated snapshots for 'dm'

* modify color and search modal snapshot test

* Updated snapshots for 'dm'

* Updated snapshots for 'rtl'

* Updated snapshots for 'default'

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Maria Neumayer <[email protected]>
  • Loading branch information
3 people authored Nov 29, 2023
1 parent 30b1500 commit 6a3cc15
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 17 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ internal fun contentResult() = BpkAppSearchModalResult.Content(
},
subtitle = buildAnnotatedString { append(stringResource(id = R.string.current_location_subtitle)) },
icon = BpkIcon.UseLocation,
) {},
onItemSelected = {},
),
),
),
BpkSection(
Expand All @@ -144,7 +145,6 @@ internal fun contentResult() = BpkAppSearchModalResult.Content(
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.City,
onItemSelected = {},

),
BpkItem(
title = buildAnnotatedString {
Expand All @@ -156,14 +156,6 @@ internal fun contentResult() = BpkAppSearchModalResult.Content(
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.Airports,
onItemSelected = {},

),
BpkItem(
title = buildAnnotatedString { append(stringResource(id = R.string.city_rome)) },
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.Airports,
onItemSelected = {},

),
),
),
Expand All @@ -177,28 +169,28 @@ internal fun contentResult() = BpkAppSearchModalResult.Content(
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.City,
onItemSelected = {},

tertiaryLabel = stringResource(id = R.string.search_modal_item_tertiary_label),
),
BpkItem(
title = buildAnnotatedString { append(stringResource(id = R.string.city_paris)) },
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.City,
onItemSelected = {},

tertiaryLabel = stringResource(id = R.string.search_modal_item_tertiary_label),
),
BpkItem(
title = buildAnnotatedString { append(stringResource(id = R.string.city_algiers)) },
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.City,
onItemSelected = {},

tertiaryLabel = stringResource(id = R.string.search_modal_item_tertiary_label),
),
BpkItem(
title = buildAnnotatedString { append(stringResource(id = R.string.city_madrid)) },
subtitle = buildAnnotatedString { append(stringResource(id = R.string.search_modal_item_subtitle)) },
icon = BpkIcon.City,
onItemSelected = {},

tertiaryLabel = stringResource(id = R.string.search_modal_item_tertiary_label),
),
),
),
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@
<string name="recent_searches">Recent Searches</string>
<string name="popular_destinations">Popular Destinations</string>
<string name="search_modal_item_subtitle">City, United Kingdom</string>
<string name="search_modal_item_tertiary_label">City</string>
<string name="view_more">View More</string>
<string name="try_again">Try Again</string>
<string name="destination">Destination</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ data class BpkItem(
val subtitle: AnnotatedString,
val icon: BpkIcon,
val onItemSelected: () -> Unit,
val tertiaryLabel: String? = null,
)

data class BpkSectionHeading(val title: String, val action: BpkAction? = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,22 @@ internal fun BpkSectionItem(item: BpkItem, modifier: Modifier = Modifier) {
icon = item.icon,
contentDescription = null,
size = BpkIconSize.Large,

)
Column {
Column(
modifier = Modifier.weight(1f),
) {
BpkText(text = item.title)
BpkText(text = item.subtitle)
BpkText(
style = BpkTheme.typography.footnote,
text = item.subtitle,
)
}
item.tertiaryLabel?.let {
BpkText(
style = BpkTheme.typography.footnote,
color = BpkTheme.colors.textSecondary,
text = it,
)
}
}
}
Binary file modified docs/compose/AppSearchModal/screenshots/content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/compose/AppSearchModal/screenshots/content_dm.png
Loading
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 6a3cc15

Please sign in to comment.