Updated on 2026-08-14
This commit is contained in:
parent
45ab6836ad
commit
5c56f04c38
52 changed files with 228 additions and 72 deletions
|
|
@ -3,6 +3,7 @@
|
|||
package com.tangem.feature.wallet.presentation.wallet.domain
|
||||
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.common.ui.userwallet.ext.walletInterationIcon
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.ui.components.notifications.NotificationConfig.ButtonsState
|
||||
import com.tangem.core.ui.components.notifications.NotificationConfig.IconTint
|
||||
|
|
@ -76,7 +77,7 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
|
||||
addSepaPromoNotification(userWallet, clickIntents, shouldShowSepaBanner)
|
||||
|
||||
addInformationalNotifications(cardTypesResolver, maybeTokenList, clickIntents)
|
||||
addInformationalNotifications(userWallet, cardTypesResolver, maybeTokenList, clickIntents)
|
||||
|
||||
addWarningNotifications(cardTypesResolver, maybeTokenList, isNeedToBackup, clickIntents)
|
||||
|
||||
|
|
@ -177,6 +178,7 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
}
|
||||
|
||||
private fun MutableList<WalletNotification>.addInformationalNotifications(
|
||||
userWallet: UserWallet,
|
||||
cardTypesResolver: CardTypesResolver?,
|
||||
maybeTokenList: Lce<TokenListError, TokenList>,
|
||||
clickIntents: WalletClickIntents,
|
||||
|
|
@ -186,10 +188,11 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
condition = cardTypesResolver != null && isDemoCardUseCase(cardId = cardTypesResolver.getCardId()),
|
||||
)
|
||||
|
||||
addMissingAddressesNotification(maybeTokenList, clickIntents)
|
||||
addMissingAddressesNotification(userWallet, maybeTokenList, clickIntents)
|
||||
}
|
||||
|
||||
private fun MutableList<WalletNotification>.addMissingAddressesNotification(
|
||||
userWallet: UserWallet,
|
||||
maybeTokenList: Lce<TokenListError, TokenList>,
|
||||
clickIntents: WalletClickIntents,
|
||||
) {
|
||||
|
|
@ -198,6 +201,7 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
|
||||
addIf(
|
||||
element = WalletNotification.Informational.MissingAddresses(
|
||||
tangemIcon = walletInterationIcon(userWallet),
|
||||
missingAddressesCount = currencies.count(),
|
||||
onGenerateClick = {
|
||||
clickIntents.onGenerateMissedAddressesClick(missedAddressCurrencies = currencies)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.feature.wallet.presentation.wallet.state.model
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.components.notifications.NotificationConfig
|
||||
|
|
@ -152,7 +153,11 @@ sealed class WalletNotification(val config: NotificationConfig) {
|
|||
),
|
||||
) {
|
||||
|
||||
data class MissingAddresses(val missingAddressesCount: Int, val onGenerateClick: () -> Unit) : Informational(
|
||||
data class MissingAddresses(
|
||||
@DrawableRes val tangemIcon: Int?,
|
||||
val missingAddressesCount: Int,
|
||||
val onGenerateClick: () -> Unit,
|
||||
) : Informational(
|
||||
title = resourceReference(id = R.string.warning_missing_derivation_title),
|
||||
subtitle = pluralReference(
|
||||
id = R.plurals.warning_missing_derivation_message,
|
||||
|
|
@ -161,7 +166,7 @@ sealed class WalletNotification(val config: NotificationConfig) {
|
|||
),
|
||||
buttonsState = NotificationConfig.ButtonsState.PrimaryButtonConfig(
|
||||
text = resourceReference(id = R.string.common_generate_addresses),
|
||||
iconResId = R.drawable.ic_tangem_24,
|
||||
iconResId = tangemIcon,
|
||||
onClick = onGenerateClick,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue