Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-18 18:19:05 +05:00
parent d0b078a793
commit 5193b7ada4
5 changed files with 9 additions and 5 deletions

View file

@ -534,6 +534,7 @@
<string name="nft_wallet_receive_nft">Tap here to receive first NFT</string>
<string name="nft_wallet_title">NFT collections</string>
<string name="nft_wallet_unable_to_load">Unable to load the data</string>
<string name="nft_no_collection">No collection</string>
<string name="onboarding_access_code_feature_1_description">Set up a single access code to protect all your devices.</string>
<string name="onboarding_access_code_feature_1_title">Protect</string>
<string name="onboarding_access_code_feature_2_description">Set an individual access code for each card or ring later.</string>

View file

@ -5,7 +5,7 @@ import com.tangem.core.ui.extensions.TextReference
internal data class NFTCollectionUM(
val id: String,
val name: String,
val name: String?,
@DrawableRes val networkIconId: Int,
val logoUrl: String?,
val description: TextReference,

View file

@ -83,7 +83,7 @@ internal class UpdateDataStateTransformer(
NFTCollectionUM(
id = it.id.toString(),
networkIconId = getActiveIconRes(it.network.id.value),
name = it.name.orEmpty(),
name = it.name,
description = TextReference.PluralRes(
R.plurals.nft_collections_count,
it.count,

View file

@ -18,6 +18,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.resolveReference
import com.tangem.core.ui.extensions.stringResourceSafe
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.features.nft.collections.entity.NFTCollectionAssetsListUM
@ -89,7 +90,7 @@ private fun RowScope.Text(state: NFTCollectionUM) {
) {
Text(
modifier = Modifier,
text = state.name,
text = state.name.takeUnless { it.isNullOrEmpty() } ?: stringResourceSafe(R.string.nft_no_collection),
style = TangemTheme.typography.subtitle2,
color = TangemTheme.colors.text.primary1,
maxLines = 1,

View file

@ -37,11 +37,11 @@ internal class NFTDetailsUMFactory(
)
} ?: NFTAssetUM.Media.Empty,
topInfo = when {
salePrice is NFTSalePrice.Empty && description.isNullOrEmpty() && rarity == null -> {
!hasSalePrice() && description.isNullOrEmpty() && rarity == null -> {
NFTAssetUM.TopInfo.Empty
}
else -> {
val hasSalePrice = salePrice !is NFTSalePrice.Empty
val hasSalePrice = hasSalePrice()
val hasDescription = !description.isNullOrEmpty()
val rarity = rarity
NFTAssetUM.TopInfo.Content(
@ -73,6 +73,8 @@ internal class NFTDetailsUMFactory(
baseInfoItems = buildBaseInfoItems(),
)
private fun NFTAsset.hasSalePrice() = salePrice !is NFTSalePrice.Empty && salePrice !is NFTSalePrice.Error
private fun NFTAsset.buildBaseInfoItems() = when (val id = id) {
is NFTAsset.Identifier.EVM -> persistentListOf(
NFTAssetUM.BlockItem(