Updated on 2026-08-14
This commit is contained in:
parent
3bfcb89e35
commit
5c0758f503
4 changed files with 13 additions and 10 deletions
|
|
@ -15,13 +15,13 @@ internal object WalletPreviewData {
|
|||
}
|
||||
|
||||
val actionButtons = persistentListOf(
|
||||
WalletActionButtons.Buy({}, true).buttonUM,
|
||||
WalletActionButtons.AddFunds({}, true).buttonUM,
|
||||
WalletActionButtons.Swap({}, true).buttonUM,
|
||||
WalletActionButtons.Sell({}, true).buttonUM,
|
||||
)
|
||||
|
||||
val disabledActionButtons = persistentListOf(
|
||||
WalletActionButtons.Buy({}, false).buttonUM,
|
||||
WalletActionButtons.AddFunds({}, false).buttonUM,
|
||||
WalletActionButtons.Swap({}, false).buttonUM,
|
||||
WalletActionButtons.Sell({}, false).buttonUM,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,14 @@ internal sealed class WalletActionButtons(
|
|||
iconRes = R.drawable.ic_plus_default_24,
|
||||
)
|
||||
|
||||
data class AddFunds(
|
||||
override val onClick: () -> Unit,
|
||||
override val isEnabled: Boolean,
|
||||
) : WalletActionButtons(
|
||||
text = resourceReference(R.string.common_add_funds),
|
||||
iconRes = R.drawable.ic_plus_default_24,
|
||||
)
|
||||
|
||||
data class Swap(
|
||||
override val onClick: () -> Unit,
|
||||
override val isEnabled: Boolean,
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ internal class InitializeWalletsTransformer(
|
|||
private fun createWalletActions(userWallet: UserWallet): PersistentList<TangemButtonUM> {
|
||||
return buildList {
|
||||
add(
|
||||
WalletActionButtons.Buy(
|
||||
WalletActionButtons.AddFunds(
|
||||
isEnabled = false,
|
||||
onClick = {},
|
||||
).buttonUM,
|
||||
|
|
|
|||
|
|
@ -187,14 +187,9 @@ internal class WalletLoadingStateFactory(
|
|||
private fun createWalletActions(userWallet: UserWallet): PersistentList<TangemButtonUM> {
|
||||
return buildList {
|
||||
add(
|
||||
WalletActionButtons.Buy(
|
||||
WalletActionButtons.AddFunds(
|
||||
isEnabled = false,
|
||||
onClick = {
|
||||
clickIntents.onMultiWalletBuyClick(
|
||||
userWalletId = userWallet.walletId,
|
||||
screenType = WALLET_TYPE,
|
||||
)
|
||||
},
|
||||
onClick = { clickIntents.onAddFundsClick(userWalletId = userWallet.walletId) },
|
||||
).buttonUM,
|
||||
)
|
||||
addIf(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue