Updated on 2026-08-14
This commit is contained in:
parent
4a9062821b
commit
19c80763c3
4 changed files with 64 additions and 23 deletions
|
|
@ -31,6 +31,7 @@ internal class SendAmountStateConverter(
|
|||
val status = cryptoCurrencyStatusProvider()
|
||||
val fiat = formatFiatAmount(status.value.fiatAmount, appCurrency.code, appCurrency.symbol)
|
||||
val crypto = formatCryptoAmount(status.value.amount, status.currency.symbol, status.currency.decimals)
|
||||
val noFeeRate = status.value.fiatRate.isNullOrZero()
|
||||
|
||||
return SendStates.AmountState(
|
||||
walletName = userWallet.name,
|
||||
|
|
@ -45,7 +46,11 @@ internal class SendAmountStateConverter(
|
|||
segmentedButtonConfig = persistentListOf(
|
||||
SendAmountSegmentedButtonsConfig(
|
||||
title = stringReference(status.currency.symbol),
|
||||
iconState = iconStateConverter.convert(status),
|
||||
iconState = if (noFeeRate) {
|
||||
iconStateConverter.convertWithGrayscale(status)
|
||||
} else {
|
||||
iconStateConverter.convert(status)
|
||||
},
|
||||
isFiat = false,
|
||||
),
|
||||
SendAmountSegmentedButtonsConfig(
|
||||
|
|
@ -54,7 +59,7 @@ internal class SendAmountStateConverter(
|
|||
isFiat = true,
|
||||
),
|
||||
),
|
||||
isSegmentedButtonsEnabled = !status.value.fiatRate.isNullOrZero(),
|
||||
isSegmentedButtonsEnabled = !noFeeRate,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -51,7 +51,10 @@ internal fun LazyListScope.buttons(
|
|||
},
|
||||
isEnabled = isSegmentedButtonsEnabled,
|
||||
) {
|
||||
SendAmountCurrencyButton(it)
|
||||
SendAmountCurrencyButton(
|
||||
button = it,
|
||||
isSegmentedButtonsEnabled = isSegmentedButtonsEnabled,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
SpacerWMax()
|
||||
|
|
@ -74,7 +77,7 @@ internal fun LazyListScope.buttons(
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun SendAmountCurrencyButton(button: SendAmountSegmentedButtonsConfig) {
|
||||
private fun SendAmountCurrencyButton(button: SendAmountSegmentedButtonsConfig, isSegmentedButtonsEnabled: Boolean) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
|
|
@ -88,17 +91,16 @@ private fun SendAmountCurrencyButton(button: SendAmountSegmentedButtonsConfig) {
|
|||
FiatIcon(
|
||||
url = button.iconUrl,
|
||||
size = TangemTheme.dimens.size18,
|
||||
isGrayscale = !isSegmentedButtonsEnabled,
|
||||
modifier = Modifier.size(TangemTheme.dimens.size18),
|
||||
)
|
||||
} else {
|
||||
button.iconState?.let {
|
||||
TokenIcon(
|
||||
state = it,
|
||||
shouldDisplayNetwork = false,
|
||||
modifier = Modifier
|
||||
.size(TangemTheme.dimens.size18),
|
||||
)
|
||||
}
|
||||
} else if (button.iconState != null) {
|
||||
TokenIcon(
|
||||
state = button.iconState,
|
||||
shouldDisplayNetwork = false,
|
||||
modifier = Modifier
|
||||
.size(TangemTheme.dimens.size18),
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = button.title.resolveReference(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue