Skip to content

Commit

Permalink
[PAN-3132] Fix bpk nudger for subtitle long case (#2014)
Browse files Browse the repository at this point in the history
* change overflow and maxline style for nudger

* Updated snapshots

* remove unuse line since default values and add more line case snapshot

* add BpkNudgerTest long subtitle case

* Updated snapshots

* Empty commit

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
noah-wen and github-actions[bot] authored Jun 17, 2024
1 parent 5ce2e93 commit fdd1530
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 2 deletions.
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 @@ -72,6 +72,11 @@ fun NudgerStory(modifier: Modifier = Modifier) {
modifier = Modifier.fillMaxWidth(),
)

NudgerRowExample(
modifier = Modifier.fillMaxWidth(),
subtitle = stringResource(R.string.generic_subtitle_long_case),
)

NudgerRowExample(
modifier = Modifier.fillMaxWidth(),
title = stringResource(R.string.generic_with_leading_icon),
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 @@ -362,6 +362,7 @@

<string name="generic_title">Title</string>
<string name="generic_subtitle">Subtitle</string>
<string name="generic_subtitle_long_case">Subtitle is an example of long text that can be wrapped</string>

<string name="inset_banner_title">Title</string>
<string name="inset_banner_sub_headline">SubHeadline</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

package net.skyscanner.backpack.compose.nudger

import androidx.compose.ui.res.stringResource
import net.skyscanner.backpack.compose.BpkSnapshotTest
import net.skyscanner.backpack.BpkTestVariant
import net.skyscanner.backpack.compose.icon.BpkIcon
import net.skyscanner.backpack.compose.tokens.Account
import net.skyscanner.backpack.Variants
import net.skyscanner.backpack.demo.R
import net.skyscanner.backpack.demo.compose.NudgerExample
import net.skyscanner.backpack.demo.compose.NudgerRowExample
import net.skyscanner.backpack.demo.compose.NudgerStoryAvg
Expand Down Expand Up @@ -88,6 +90,12 @@ class BpkNudgerTest : BpkSnapshotTest() {
NudgerRowExample(subtitle = null)
}

@Test
@Variants(BpkTestVariant.Default)
fun withLongSubtitle() = snap {
NudgerRowExample(subtitle = stringResource(R.string.generic_subtitle_long_case))
}

@Test
@Variants(BpkTestVariant.Default)
fun withNoIcon() = snap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ fun BpkNudger(
text = subtitle,
style = BpkTheme.typography.bodyDefault,
color = BpkTheme.colors.textSecondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.invisibleSemantic(),
)
}
Expand Down
Binary file modified docs/compose/Nudger/screenshots/default.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/Nudger/screenshots/default_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 fdd1530

Please sign in to comment.