Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ private fun ContactList(
)
.then(modifier),
state = listState,
contentPadding = PaddingValues(bottom = CodeTheme.dimens.grid.x3),
) {
itemsIndexed(
items = items,
Expand Down Expand Up @@ -437,17 +438,21 @@ private fun ContactRowItem(
}
}

Text(
text = if (isOnFlipcash && !lastMessagePreview.isNullOrEmpty()) {
lastMessagePreview
} else {
contact.displayNumber.ifEmpty { contact.e164 }
},
style = CodeTheme.typography.textSmall,
color = CodeTheme.colors.textSecondary,
maxLines = 1,
overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis,
)
val showSubtitle = lastMessagePreview != null || !isOnFlipcash

if (showSubtitle) {
Text(
text = if (isOnFlipcash && !lastMessagePreview.isNullOrEmpty()) {
lastMessagePreview
} else {
contact.displayNumber.ifEmpty { contact.e164 }
},
style = CodeTheme.typography.textSmall,
color = CodeTheme.colors.textSecondary,
maxLines = 1,
overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis,
)
}
}

if (isOnFlipcash) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class SendFlowViewModelStateTest {
@Test
fun `OnStepChanged to PhoneGate updates currentStep`() {
val updated = reduce(
SendFlowViewModel.Event.OnStepChanged(SendStep.Intro)
SendFlowViewModel.Event.OnStepChanged(SendStep.PhoneGate)
)(SendFlowViewModel.State())
assertEquals(SendStep.Intro, updated.currentStep)
assertEquals(SendStep.PhoneGate, updated.currentStep)
}

@Test
Expand All @@ -40,7 +40,7 @@ class SendFlowViewModelStateTest {

@Test
fun `OnStepChanged replaces previous step`() {
val state = SendFlowViewModel.State(currentStep = SendStep.Intro)
val state = SendFlowViewModel.State(currentStep = SendStep.PhoneGate)
val updated = reduce(
SendFlowViewModel.Event.OnStepChanged(SendStep.ContactList)
)(state)
Expand All @@ -50,7 +50,7 @@ class SendFlowViewModelStateTest {
@Test
fun `OnStepChanged does not affect other state`() {
val state = SendFlowViewModel.State(
steps = listOf(SendStep.Intro, SendStep.ContactList),
steps = listOf(SendStep.PhoneGate, SendStep.ContactList),
isPickerMode = true,
)
val updated = reduce(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ private fun CashBubble(
text = text,
style = CodeTheme.typography.displayMedium,
color = CodeTheme.colors.textMain,
autoSize = TextAutoSize.StepBased(minFontSize = 20.sp),
autoSize = TextAutoSize.StepBased(
minFontSize = 20.sp,
maxFontSize = CodeTheme.typography.displayMedium.fontSize
),
maxLines = 1,
)
}
Expand Down
Loading