Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-02 23:41:01 +03:00
parent 3580350769
commit 8aba7b07d1
49 changed files with 172 additions and 134 deletions

View file

@ -28,9 +28,9 @@ fun assertEitherRight(actual: Either<Throwable, Unit>) {
fun <B> assertEitherLeft(actual: Either<Throwable, B>, expected: Throwable) {
actual
.onRight { error("Actual is Either.Right: $it") }
.onLeft {
Truth.assertThat(it::class.java).isEqualTo(expected::class.java)
Truth.assertThat(it).hasMessageThat().isEqualTo(expected.message)
.onLeft { throwable ->
Truth.assertThat(throwable::class.java).isEqualTo(expected::class.java)
Truth.assertThat(throwable).hasMessageThat().isEqualTo(expected.message)
}
}

View file

@ -77,7 +77,7 @@ fun AmountBlockV2(
)
}
@Suppress("LongParameterList")
@Suppress("LongParameterList", "LongMethod")
@Composable
private fun AmountBlockV2(
title: TextReference,
@ -97,7 +97,10 @@ private fun AmountBlockV2(
.clip(TangemTheme.shapes.roundedCornersXMedium)
.background(TangemTheme.colors.background.action)
.conditional(onClick != null) {
clickable(enabled = !isClickDisabled && !isEditingDisabled, onClick = onClick!!)
clickable(
enabled = !isClickDisabled && !isEditingDisabled,
onClick = requireNotNull(onClick),
)
}
.padding(TangemTheme.dimens.spacing16),
) {
@ -121,7 +124,9 @@ private fun AmountBlockV2(
) {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
modifier = Modifier.padding(top = 8.dp).weight(1f),
modifier = Modifier
.padding(top = 8.dp)
.weight(1f),
) {
ResizableText(
text = firstAmount,

View file

@ -222,10 +222,8 @@ private fun AmountItem(
isExpanded = isExpandSelector,
onDismiss = { isExpandSelector = false },
onItemClick = { approveType ->
onChangeApproveType.let {
isExpandSelector = false
onChangeApproveType.invoke(approveType)
}
isExpandSelector = false
onChangeApproveType.invoke(approveType)
},
items = approveItems,
selectedType = approveType,