Updated on 2026-08-14
This commit is contained in:
parent
acf110dbcc
commit
6910f74fd9
242 changed files with 866 additions and 732 deletions
|
|
@ -12,7 +12,7 @@ interface ChooseManagedTokensComponent : ComposableContentComponent {
|
|||
val initialCurrency: CryptoCurrency,
|
||||
val selectedCurrency: CryptoCurrency?,
|
||||
val source: Source,
|
||||
val showSendViaSwapNotification: Boolean,
|
||||
val shouldShowSendViaSwapNotification: Boolean,
|
||||
val callback: ModelCallback? = null,
|
||||
val analyticsCategoryName: String,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import com.tangem.core.analytics.models.AnalyticsParam.Key.TOKEN_PARAM
|
|||
sealed class CommonManageTokensAnalyticEvents(
|
||||
category: String,
|
||||
event: String,
|
||||
params: Map<String, String> = mapOf(),
|
||||
params: Map<String, String> = emptyMap(),
|
||||
) : AnalyticsEvent(category = category, event = event, params = params) {
|
||||
|
||||
data class TokenSearchClicked(
|
||||
|
|
@ -26,8 +26,8 @@ sealed class CommonManageTokensAnalyticEvents(
|
|||
event = "Token Searched",
|
||||
params = buildMap {
|
||||
put(CHOSEN_TOKEN, if (isTokenChosen) "Yes" else "No")
|
||||
token?.let { put(TOKEN_PARAM, token) }
|
||||
blockchain?.let { put(BLOCKCHAIN, blockchain) }
|
||||
if (token != null) { put(TOKEN_PARAM, token) }
|
||||
if (blockchain != null) { put(BLOCKCHAIN, blockchain) }
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ internal class ChooseManagedTokensModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun getNotification(): NotificationUM? {
|
||||
return if (params.source == Source.SendViaSwap && params.showSendViaSwapNotification) {
|
||||
return if (params.source == Source.SendViaSwap && params.shouldShowSendViaSwapNotification) {
|
||||
ChooseManagedTokensNotificationUM.SendViaSwap(onCloseClick = ::removeNotification)
|
||||
} else {
|
||||
null
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ private fun LazyListScope.contentItems(items: ImmutableList<CurrencyItemUM>) {
|
|||
name = name,
|
||||
type = symbol,
|
||||
icon = icon,
|
||||
showCustom = false,
|
||||
shouldShowCustom = false,
|
||||
)
|
||||
},
|
||||
modifier = Modifier
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ internal class PreviewManageTokensComponent(
|
|||
background = Color.Black,
|
||||
topBadgeIconResId = R.drawable.img_eth_22,
|
||||
isGrayscale = false,
|
||||
showCustomBadge = true,
|
||||
shouldShowCustomBadge = true,
|
||||
),
|
||||
onRemoveClick = {},
|
||||
)
|
||||
|
|
@ -141,7 +141,7 @@ internal class PreviewManageTokensComponent(
|
|||
url = null,
|
||||
fallbackResId = R.drawable.img_btc_22,
|
||||
isGrayscale = false,
|
||||
showCustomBadge = false,
|
||||
shouldShowCustomBadge = false,
|
||||
),
|
||||
networks = if (index == 2) {
|
||||
CurrencyItemUM.Basic.NetworksUM.Expanded(getCurrencyNetworks(index))
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ internal class PreviewOnboardingManageTokensComponent(
|
|||
background = Color.Black,
|
||||
topBadgeIconResId = R.drawable.img_eth_22,
|
||||
isGrayscale = false,
|
||||
showCustomBadge = true,
|
||||
shouldShowCustomBadge = true,
|
||||
),
|
||||
onRemoveClick = {},
|
||||
)
|
||||
|
|
@ -79,7 +79,7 @@ internal class PreviewOnboardingManageTokensComponent(
|
|||
url = null,
|
||||
fallbackResId = R.drawable.img_btc_22,
|
||||
isGrayscale = false,
|
||||
showCustomBadge = false,
|
||||
shouldShowCustomBadge = false,
|
||||
),
|
||||
networks = if (index == 2) {
|
||||
CurrencyItemUM.Basic.NetworksUM.Expanded(getCurrencyNetworks())
|
||||
|
|
|
|||
|
|
@ -163,9 +163,9 @@ private fun NetworkItem(model: CurrencyNetworkUM, modifier: Modifier = Modifier)
|
|||
url = null,
|
||||
fallbackResId = model.iconResId,
|
||||
isGrayscale = false,
|
||||
showCustomBadge = false,
|
||||
shouldShowCustomBadge = false,
|
||||
),
|
||||
showCustom = false,
|
||||
shouldShowCustom = false,
|
||||
)
|
||||
},
|
||||
action = {
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ private fun CustomCurrencyItem(item: CurrencyItemUM.Custom, modifier: Modifier =
|
|||
name = name,
|
||||
type = symbol,
|
||||
icon = icon,
|
||||
showCustom = true,
|
||||
shouldShowCustom = true,
|
||||
)
|
||||
},
|
||||
action = {
|
||||
|
|
@ -316,7 +316,7 @@ private fun BasicCurrencyItem(item: CurrencyItemUM.Basic, isEditable: Boolean, m
|
|||
name = name,
|
||||
type = symbol,
|
||||
icon = icon,
|
||||
showCustom = false,
|
||||
shouldShowCustom = false,
|
||||
)
|
||||
},
|
||||
action = {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ internal fun CustomDerivationInputDialog(model: CustomDerivationInputUM, onDismi
|
|||
fieldValue = value,
|
||||
confirmButton = DialogButtonUM(
|
||||
title = stringResourceSafe(id = R.string.common_ok),
|
||||
enabled = model.isConfirmEnabled,
|
||||
isEnabled = model.isConfirmEnabled,
|
||||
onClick = model.onConfirm,
|
||||
),
|
||||
dismissButton = DialogButtonUM(
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ internal class ManageTokensWarningDelegate @AssistedInject constructor(
|
|||
firstActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = resourceReference(R.string.token_details_hide_alert_hide),
|
||||
warning = true,
|
||||
isWarning = true,
|
||||
onClick = onConfirm,
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ private fun ManagedCryptoCurrency.Custom.toUiModel(
|
|||
url = iconUrl,
|
||||
fallbackResId = network.id.getIconRes(isColored = true),
|
||||
isGrayscale = false,
|
||||
showCustomBadge = true,
|
||||
shouldShowCustomBadge = true,
|
||||
)
|
||||
}
|
||||
is ManagedCryptoCurrency.Custom.Token -> {
|
||||
|
|
@ -44,7 +44,7 @@ private fun ManagedCryptoCurrency.Custom.toUiModel(
|
|||
fallbackTint = getTintForTokenIcon(background),
|
||||
topBadgeIconResId = network.id.getIconRes(isColored = true),
|
||||
isGrayscale = false,
|
||||
showCustomBadge = true,
|
||||
shouldShowCustomBadge = true,
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
@ -68,7 +68,7 @@ private fun ManagedCryptoCurrency.Token.toUiModel(
|
|||
url = iconUrl,
|
||||
topBadgeIconResId = null,
|
||||
isGrayscale = if (isEditable) !isAdded else false,
|
||||
showCustomBadge = false,
|
||||
shouldShowCustomBadge = false,
|
||||
fallbackTint = getTintForTokenIcon(background),
|
||||
fallbackBackground = background,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue